Я пытаюсь добавить границу вокруг UITextView, используя
self.textView.layer.borderWidth = 1;
self.textView.layer.borderColor = [[UIColor brownColor] CGColor];
но оно не появляется. Если кто-нибудь может помочь мне с тем, почему он не появляется. Даже если я добавил Quartz Framework. Но все еще не появляется.
#import "uitextviewViewController.h"
#import <QuartzCore/QuartzCore.h>
@implementation uitextviewViewController
@synthesize textView;
@synthesize navBar;
- (void)dealloc {
[navBar release];
[textView release];
[super dealloc];
}
- (void) viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem * button = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self
action:@selector(done:)];
[[self navigationItem] setRightBarButtonItem:button];
[button release];
self.textView = [[[UITextView alloc] initWithFrame:self.view.frame] autorelease];
self.textView.textColor = [UIColor whiteColor];
self.textView.font = [UIFont fontWithName:@"Arial" size:15];
self.textView.delegate = self;
self.textView.backgroundColor = [UIColor brownColor];
self.textView.layer.borderWidth = 1;
self.textView.layer.borderColor = [[UIColor brownColor] CGColor];
self.textView.textAlignment = UITextAlignmentCenter;
self.textView.text = @"This is UITextView\n\nThis is UITextView\n\nThis is UITextView\n\nThis is UITextView\n\nThis is UITextView.";
self.textView.scrollEnabled = YES;
[self.view addSubview: self.textView];
}
Буду признателен за помощь.
Заранее спасибо.