相关疑难解决方法(0)

如何在iOS中的UIAlertview中插入UITextView

此外,我希望这个UITextView与XXX.txt中的文本文件.它在i​​OS6中工作正常,但内容不会出现在iOS7的UIAlertview上.我的代码如下: -

UITextView *tosTextView = [[UITextView alloc]initWithFrame:CGRectMake(12, 48, 260, 140)];

NSString *path = [[NSBundle mainBundle] pathForResource:@"TJTermsof Service"
                                                 ofType:@"txt"];
NSString *content = [NSString stringWithContentsOfFile:path
                                              encoding:NSUTF8StringEncoding
                                                 error:NULL];
[tosTextView setText:content];

tosTextView.textColor=[UIColor blackColor];
tosTextView.font = [UIFont fontWithName:@"LuzSans-Book" size:17];
tosTextView.editable = NO;
customAlert = [[UIAlertView alloc]initWithTitle:@" TOS \n\n\n\n\n\n " message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"I Agree",nil];



[customAlert addSubview:tosTextView];

[customAlert show];
Run Code Online (Sandbox Code Playgroud)

objective-c uialertview ios swift

10
推荐指数
2
解决办法
1万
查看次数

标签 统计

ios ×1

objective-c ×1

swift ×1

uialertview ×1