我有一个UIAlertView
with UITextView
。在ViewDidAppear
我[textView setText:]
使用大文本时,但警报显示一个空的 textView,并且只有在我触摸 textView 进行滚动后,才会出现文本。
我应该怎么做才能使文本出现在警报的 textView 中,而不滚动它以“刷新”它?
谢谢!
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
av = [[UIAlertView alloc]initWithTitle:@"Terms of Service" message:@"\n\n\n\n\n\n\n" delegate:self cancelButtonTitle:@"Disagree" otherButtonTitles:@"Agree",nil];
UITextView *myTextView = [[UITextView alloc] initWithFrame:CGRectMake(12, 50, 260, 142)];
[myTextView setTextAlignment:UITextAlignmentCenter];
[myTextView setEditable:NO];
myTextView.layer.borderWidth = 2.0f;
myTextView.layer.borderColor = [[UIColor darkGrayColor] CGColor];
myTextView.layer.cornerRadius = 13;
myTextView.clipsToBounds = YES ;
[myTextView setText:@"LONG LONG TEXT"];
[av addSubview:myTextView];
[myTextView release];
[av setTag:1];
[av show];
}