如何在UIAlertView iPhone中添加TextView 320 * 460 [英] How to add TextView 320*460 in UIAlertView iPhone
问题描述
我在开始时显示EULA,UIAlertView有Accept按钮。我已成功按照选择页面的问题(许可协议页面)进行了回答链接。
I am showing EULA at the start with UIAlertView having Accept button. I have successfully followed answer on Problem with opning the page (License agreement page) link.
我只想在开始时显示6页的EULA,但我无法在Alertview中显示具有EULA内容的完整大小的textview / scrollview 。任何人都可以建议我正确的方式。在此先感谢。
I just want to show 6 pages of EULA at the start but I am unable to show the full size textview/scrollview having EULA content in Alertview. Can anyone suggest me the proper way. Thanks in advance.
推荐答案
您可以制作任何大小的alertView并添加任意大小的自定义TextView。使用代码snippiest
You can make alertView of any size and add custom TextView of any size. Use code snippiest
- (void) doAlertViewWithTextView {
UIAlertView *alert = [[UIAlertView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
alert.title = nil;
alert.message = nil;
alert.delegate = self;
[alert addButtonWithTitle:@"Cancel"];
[alert addButtonWithTitle:nil];
UITextView *textView = [[UITextView alloc] initWithFrame:alert.bounds];
textView.text = @"This is what i am trying to add in alertView.\nHappy New Year Farmers! The new Winter Fantasy Limited Edition Items have arrived! Enchant your orchard with a Icy Peach Tree, and be the first farmer among your friends to have the Frosty Fairy Horse. Don't forget that the Mystery Game has been refreshed with a new Winter Fantasy Animal theme! ";
textView.keyboardAppearance = UIKeyboardAppearanceAlert;
textView.editable = NO;
[alert addSubview:textView];
[textView release];
[alert show];
[alert release];
}
但是通过制作尺码alertView等于整个iPhone屏幕的大小,你将失去取消按钮。
But by making the size of alertView equal to size of whole iPhone screen you will lose cancel button.
也使用这种委托方法。
- (void)willPresentAlertView:(UIAlertView *)alertView {
[alertView setFrame:CGRectMake(0, 0, 320, 460)];}
这篇关于如何在UIAlertView iPhone中添加TextView 320 * 460的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!