问题描述
我想像此应用程序一样创建带有圆角和UIButton的类似UIView.我可以在Interface Builder上实现它吗?
I want to create a similar UIView with rounded corner and UIButton just like this app.Can I implement this on Interface Builder?
推荐答案
只需在代码中包含QuartzCore框架,就可以在拐角处设置边界并在代码中设置边框.
You can round the corners and set a border in code, just make sure you have QuartzCore framework included.
-(void) viewDidLoad {
[super viewDidLoad];
self.welcomeView.layer.cornerRadius = 5;
self.welcomeView.layer.borderWidth = 2;
self.welcomeView.layer.borderColor = [[UIColor whiteColor] CGColor];
}
然后只是布置您的视图并在IB中设置您的网点.那应该可以让您进入Quartz中很多很棒的东西.
Then just lay out your views and setup your outlets in IB. That should get you going, lots of cool stuff in Quartz.
Here is a link to the API reference http://developer.apple.com/library/mac/ipad/#documentation/graphicsimaging/reference/CALayer_class/Introduction/Introduction.html%23//apple_ref/doc/uid/TP40004500
这篇关于如何创建自定义的圆形UiView和UIButton(如MobilePASS)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!