I need to draw a rounded rectangle bar in my iOS application, but without using a background image. Is there any way to make a rounded rectangle view or label?
A technical word for this kind of shape is Oblong.
In addition to the other answer(s), don't forget to set the masksToBounds
property.
#import <QuartzCore/QuartzCore.h>
label.layer.cornerRadius = 5.0;
label.layer.masksToBounds = YES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With