scollview显示在文本的顶部和后面绘制文本如何克服此问题。下面是代码当我在alertview上添加textview时,将TextView添加到UIAlertView
问题更新:
如果设定textView.editable = NO;它工作正常,但在我的情况下,我需要在textview中键入文本。
UITextView *textView = [[UITextView alloc]initWithFrame:CGRectMake(12, 50, 260, 50)];
[textView setText:@"lashdasjh asdasjdas asdlajsdl adsjajadsd aslj daj sdjasdjasjdlasjd as dlasj d"];
UIAlertView *av = [[UIAlertView alloc]initWithTitle:@"Type Your Message" message:@"\n\n\n\n\n\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Send",nil];
av.alertViewStyle = UIAlertViewStyleDefault;
[av addSubview:textView];
[av show];
http://stackoverflow.com/questions/9060310/how-to-add-textview- 320460-uialertview-iphone – Rushabh 2013-03-05 07:13:13
我会认为12会是一个更大的数字 – 2013-03-05 07:13:24
+1注意,似乎很奇怪。 – doge 2013-03-05 07:18:01