4

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;
}
Community
  • 1
  • 1
gebirgsbärbel
  • 2,327
  • 1
  • 22
  • 38

1 Answers1

19

Add the QuartzCore framework in your project

Include this in your .h file

#import <QuartzCore/QuartzCore.h>
ipraba
  • 16,485
  • 4
  • 59
  • 58
  • 1
    Thank you, I just figured it out. It also says so in the other stackoverflow post. Reading sometimes helps :) This time I was just too blind... – gebirgsbärbel Jul 08 '11 at 11:55