I wanted to add rounded Rects to a UITextView as explained in How to style UITextview to like Rounded Rect text field?. However when I do this I receive an error message that the methods used there are not found. I think this is weird as they are also still in the documentation. On the other side XCode does not show anything in autocomplete on the field layer. Is this field somehow deprecated or where could be the problem?
Here the two code snippets I was using:
@interface AddItemViewController : UIViewController {
IBOutlet UITextView *detailsTextView;
}
@end
Hier will ich dann die Eigenschaften aendern.
- (void)viewDidLoad
{
[super viewDidLoad];
// add rounded rects to detailsTextView
//first leads to warning that method is unknown
[detailsTextView.layer setCornerRadius:8.0f];
// displays error that property is not found on object of type CALayer *
textView.layer.cornerRadius = 8.0f;
detailsTextView.clipsToBounds = YES;
}
Add the QuartzCore framework in your project
Include this in your .h file
#import <QuartzCore/QuartzCore.h>
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