UITextView UIAlertView中的大文本

Yos*_*han 2 iphone objective-c ios4 ios

我有一个UIAlertViewUITextView.在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];
Run Code Online (Sandbox Code Playgroud)

}

Nit*_*ish 5

这是因为你已经初步确定消息@ "\n \n \n \n \n \n \n"UIAlertView.设置您的UITextView第一个,然后将UIAlertView消息设置为textView的文本.