Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chhoda

macrumors 6502
Original poster
Oct 25, 2008
285
1
Hi All,
I need to show rounded rectangle borders in my views, but i could not find a way !

regards
CH
 
Since every UIView is backed by a Core Animation layer, you can work directly on the layer if you want.

If you are building for 3.0 or higher, you have access to CALayer properties like cornerRadius, borderWidth, and borderColor. Those three should do exactly what you are looking for.
 
place a uiimageview in you view and put a transparent bordered png image on imageview.

Don't use an image unless you have a very complicated design. If you can, just use the layer properties or override drawRect.

My biggest pet peeve is when developers use bitmap images for their UI when it could be drawn in code.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.