views:

60

answers:

3

How can I create UIButton in iphone app programatically to have square corners. I don't want to have rounded corners.

A: 

Set a image in the background.
Have a look

org.life.java
don't use that image though :)
willcodejavaforfood
:) :) yeah that is for sure
org.life.java
A: 

take a custom button and change its background color.

The button will be having squared corners or the other alternate is set image as background to the button. You can choose whatever you like as per your requirement.

Happy Coding...

Suriya
A: 

Set it's buttonType to UIButtonTypeCustom so it doesn't draw the rounded rect, then give the UIButton's layer a border:

//you need this import
#import <QuartzCore/QuartzCore.h>

[button.layer setBorderColor: [[UIColor blackColor] CGColor]];
[button.layer setBorderWidth: 2.0];
mclin