I want to create a similar UIView with rounded corner and UIButton just like this app. Can I implement this on Interface Builder?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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];
}
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
回答2:
Take a look at this tutorial by Ray Wenderlich.