Reputation: 1151
I wanna create a button with border in Xcode 6. For instance, I want it to look like the buttons from this library - https://github.com/a1anyip/AYVibrantButton - without any special visual effects. Is it possible to achieve this by doing some setup in IB without writing any code? Thanks.
Upvotes: 12
Views: 33289
Reputation:
"addImageButton" here is my UIButton and I am using below lines of code to create border to the button.
[addImageButton.layer setBorderWidth:5];
[addImageButton.layer setBorderColor:[[UIColor redColor] CGColor]];
[addImageButton setTintColor:[UIColor whiteColor]];
[addImageButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
Hope this solves your issue.
Upvotes: 8