border in view

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

  1. macrumors 6502

    Joined:
    Oct 25, 2008
    #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

    Joined:
    May 6, 2009
    #2
    place a uiimageview in you view and put a transparent bordered png image on imageview.
     
  3. macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #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

    Joined:
    Jun 15, 2000
    #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