我以编程方式将UITextView添加到UIView。一开始,UITextView应该具有清晰的背景,但是背景是从白色到清晰的动画。如何防止此动画?这是我的代码:
UITextView *localTextView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 230, 60)];
localTextView.opaque = NO;
localTextView.backgroundColor = [UIColor clearColor];
localTextView.font = [UIFont fontWithName:@"Helvetica" size:14];
localTextView.userInteractionEnabled = NO;
self.textView = localTextView;
[localTextView release];
textView.text = @"Cras sit amet purus vitae libero venenatis luctus sit amet non urna. Curabitur volutpat adipis cing nulla, in lacinia eros pulvinar vitae.";
[self addSubview:textView];
谢谢你的帮助。
最佳答案
您可以尝试在
-(void)viewWillAppear:(BOOL*)animated;
方法