Brian David Berman
Brian David Berman

Reputation: 7684

Get rid of rounded corners of Round Rect Button (MonoTouch)

I want to get rid of the rounded corners of a UIButton (type = Round Rect Button). I want to stack some buttons to give a UITableView look and want to get rid of the rounded corners in some instances. Is this possible? (MonoTouch)

Upvotes: 0

Views: 780

Answers (3)

MatLecu
MatLecu

Reputation: 953

If th type is rounded rect, it has the rouded corner. Use a custom type to do exactly what you want.

If you're in interface builder, just select custom type, you can then use a background image or normal layer attributes (border, shadow...).

In code, don't create a new classe, jsut create a button and set the type to custom.

Upvotes: 1

poupou
poupou

Reputation: 43553

Have a look at UIButtonType to see all the types of button you can create (including a custom one). E.g.

var b = new UIButton ();    
b.ButtonType = UIButtonType.Custom;

OTOH if you want to do things that looks like UITableView then I strongly suggest you to look at MonoTouch.Dialog and its sample application - which includes ownerdraw elements. It will be as easy (or easier) than dealing with several buttons (and much easier than using UITableView).

Upvotes: 0

Peter Kazazes
Peter Kazazes

Reputation: 3628

Create the image of the button you want (in Photoshop, or whatever else floats your boat), change the button type to "Custom" and then import the created image to your project and set it under the "Image:" drop down in Interface Builder.

Tada, customization complete.

Upvotes: 0

Related Questions