Putting a black border around a view?

Discussion in 'iPhone/iPad Programming' started by fenrus110, Nov 7, 2008.

  1. macrumors regular

    Joined:
    Mar 24, 2008
    #1
    Is there an easy way to put a black border around a view? I can set a backgroundColor to like yellow, but I want the edges to be black.

    Only thing that comes to mind for me is to use an UIImageView and stick it behind. That seems kinda cumbersome, especially when I plan to move some of these views with touches.
     
  2. macrumors regular

    Joined:
    Mar 24, 2008
    #2
    Use a UIImageView, added as a subview. I think if you assign it a UIImage with that you make stretchable with stretchableImageWithLeftCapWidth:topCapHeight: you will be able to scale and move the superview without a poblem. Just be sure to set the image view to the proper autoresizeMask it should be no problem.

    This method should even allow you to create pretty rounded corners or something.
     

Share This Page