iOS Buttons - add border

user1509593 picture user1509593 · Aug 18, 2013 · Viewed 83k times · Source

I am making my app ready for iOS7. I did conversion and was working with a user. The button in the app does not look like button. Looks very flat. Is there someway to put border or make it stand like a button?

Answer

Mehul Thakkar picture Mehul Thakkar · Sep 19, 2013

Try this for adding border, It will work

#import <QuartzCore/QuartzCore.h>

then in viewDidLoad

_btn.layer.borderWidth=1.0f;
_btn.layer.borderColor=[[UIColor blackColor] CGColor];
_btn.layer.cornerRadius = 10;

also you can fill the color for making appearance somewhat like button, or best way is to use image there

Apart from BorderColor, you can do it by using Runtime attributes too.

enter image description here