1

Possible Duplicate:
How do I create a round cornered UILabel on the iPhone?
how to use rounded corner label in iphone,UILabel Round Corners

Still pretty much getting started with Xcode and Interface Builder. I made a UI screen with several 'label' fields to display random data. But when I change the label color from the screen background color, it looks awful because they're perfect squares. Is there a way to round the corners for labels?

Thanks!

Community
  • 1
  • 1
Jay Kim
  • 793
  • 4
  • 10
  • 26
  • I just looked at that. Dumb question: where do I type in that code? – Jay Kim Jun 21 '12 at 19:00
  • This question will make more sense if the question really was about achieving rounded corners directly in Interface Builder, which is possible an not a duplicate of any of the questions on top. – Rivera May 13 '15 at 15:35

1 Answers1

1

Quoting from another SO answer:

iPhone OS 3.0 and later supports the cornerRadius property on the CALayer class. Every view has a CALayer instance that you can manipulate. This means you can get rounded corners in one line now:

That post has a pretty detailed description of how to implement this behavior.

Community
  • 1
  • 1
Ben Jacobs
  • 2,486
  • 4
  • 22
  • 33
  • I just looked at that. Dumb question: where do I type in that code? – Jay Kim Jun 21 '12 at 19:00
  • 1
    You'll need to connect the label to your view by creating an IBOutlet (in your .h file) and synthesizing it (in your .m file). I would do the configuration in the ViewController's viewDidLoad. – Ben Jacobs Jun 21 '12 at 19:07