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
" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"I Agree",nil];
[customAlert addSubview:tosTextView];
[customAlert show];
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…