iphone - 如何创建像 MobilePASS 一样的自定义圆角 UiView 和 UIButton?

标签 iphone uiview uibutton

我想创建一个类似的带有圆角的 UIView 和 UIButton 就像这个应用程序一样。 我可以在 Interface Builder 上实现这个吗?

enter image description here

最佳答案

您可以在代码中圆角并设置边框,只需确保包含 QuartzCore 框架即可。

-(void) viewDidLoad {
    [super viewDidLoad];

    self.welcomeView.layer.cornerRadius = 5;
    self.welcomeView.layer.borderWidth = 2;
    self.welcomeView.layer.borderColor = [[UIColor whiteColor] CGColor];

}

然后只需在 IB 中阐述您的观点并设置您的 channel 即可。这应该能让你继续前进,Quartz 中有很多很酷的东西。

这里是 API 引用的链接 http://developer.apple.com/library/mac/ipad/#documentation/graphicsimaging/reference/CALayer_class/Introduction/Introduction.html%23//apple_ref/doc/uid/TP40004500

关于iphone - 如何创建像 MobilePASS 一样的自定义圆角 UiView 和 UIButton?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8627791/

相关文章:

objective-c - UIButton 在选择时拉伸(stretch)图像

ios - 触摸时显示不同的按钮图像

iphone - 如何应用多个应用程序更新?

objective-c - 测试枚举给出警告 : comparison between pointer and integer

iphone - Xcode 4 中没有 gcc 4.2 编译器选项?

ios - 工具栏下方的 UIImageView CurlUp 过渡

ios - 动画时避免状态栏透明

android - 移动分析中的事件持续时间?

ios - 旋转设备时,动画 uiview 切换回其原始状态

ios - 标签栏上的 UIButton