本文介绍了如何在iOS 7中找回UIButton边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 iOS上建立了一个旧项目Xcode 5中的SDK 6.1 .但是,当应用程序在运行iOS 7的iPhone上运行时,UIbutton是无边界的.我已检查.xib
是"Builds for">"Project Deployment Target(5.0)":
I built an old project in iOS SDK 6.1 in Xcode 5. However, the UIbutton is borderless when the app runs on an iPhone running iOS 7. I have checked the .xib
is "Builds for" > "Project Deployment Target (5.0)":
如何配置Xcode 5以构建项目以显示iOS 6.1风格的UIButton?
How can I config Xcode 5 to build the project to show an iOS 6.1-style UIButton?
推荐答案
您可以创建一个类别:
- (void)setRoundedBorder:(float) radius borderWidth:(float)borderWidth color:(UIColor*)color
{
CALayer * l = [self layer];
[l setMasksToBounds:YES];
[l setCornerRadius:radius];
// You can even add a border
[l setBorderWidth:borderWidth];
[l setBorderColor:[color CGColor]];
}
这篇关于如何在iOS 7中找回UIButton边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!