如何在iOS中将UITextView插入UIAlertview [英] How to Insert the UITextView into UIAlertview in iOS
本文介绍了如何在iOS中将UITextView插入UIAlertview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
另外,我希望这个UITextView带有XXX.txt中的文本文件。它在iOS6中工作正常,但内容没有出现在iOS7的UIAlertview中。我的代码如下: -
Also, I would like this UITextView with the text file in XXX.txt.It works fine in iOS6, but content does not appear on the UIAlertview in iOS7. my code is given as below:-
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];
推荐答案
以下链接解决了我的问题,链接是 https://github.com/wimagguc/ios-custom-alertview
the following link has resolved my problem, the link is https://github.com/wimagguc/ios-custom-alertview
以下内容已解决
- textview
- tableview
- ImageView
- UIWebView
- textview
- tableview
- ImageView
- UIWebView
两种功能对我来说工作得很好
both functionalities are worked as fine for me
这篇关于如何在iOS中将UITextView插入UIAlertview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文