PDA

View Full Version : border in view




chhoda
Dec 2, 2008, 11:34 PM
Hi All,
I need to show rounded rectangle borders in my views, but i could not find a way !

regards
CH



rahulvyas
Dec 19, 2009, 06:15 AM
place a uiimageview in you view and put a transparent bordered png image on imageview.

North Bronson
Dec 19, 2009, 02:22 PM
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.

kainjow
Dec 19, 2009, 03:38 PM
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.