How to create a customized rounded UiView and UIBu

2019-07-14 12:48发布

问题:

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.