1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

border in view

Discussion in 'iPhone/iPad Programming' started by chhoda, Dec 2, 2008.

  1. macrumors 6502

    #1
    Hi All,
    I need to show rounded rectangle borders in my views, but i could not find a way !

    regards
    CH
     
  2. macrumors newbie

    #2
    place a uiimageview in you view and put a transparent bordered png image on imageview.
     
  3. macrumors 6502

    #3
    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.
     
  4. Moderator emeritus

    kainjow

    #4
    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.
     

Share This Page