UITextView 未加载/显示大文本? [英] UITextView not loading/showing the large text?
问题描述
我的登录屏幕中有一个简单的 UITextView,我需要在其中显示条款 &条件.我在条款和条件中有一个非常大的文本.在界面构建器中,我向 UITextView 添加了文本.在界面构建器中,文本正确显示.但是当我运行应用程序时 UITextView 是空的.如果我在 UItextView 中给出小文本,它会正确呈现,但未显示大/大文本.
I have a simple UITextView in my login screen where I need to display Terms & conditions.I have a very large text in Terms and Conditions.In the interface builder I have added text to the UITextView. In the interface builder the text is getting showed properly. But when I run the application the UITextView is empty. If I give small text in the UItextView it is rendering properly but huge/large text is not getting displayed.
谁能帮帮我.
这是代码.
- (IBAction)showTermsOfUse:(id)sender{
termsOfUseText.text = @"/***/";
termsOfUseText.scrollEnabled = YES;
[UIView beginAnimations:nil context:nil]; // begins animation block
[UIView setAnimationDuration:0.6]; // sets animation duration
[UIView setAnimationDelegate:self];
termsOfUse.frame = CGRectMake(0,0,320,416);
[UIView commitAnimations]; // commits the animation block. This Block is done.
}
推荐答案
我也遇到了同样的问题,我解决了这个问题,我采用了 UITextView 的 IBOutlet 并在代码中设置了这样的值
I also had faced the same problem and i solved it my taking IBOutlet of UITextView and setting the value in the code like this
UITextView *txtView=[[UITextView alloc] initWithFrame:CGRectMake(50, 50, 200, 200)];
[txtView setText:@"Your long text"];
[txtView setEditable:NO];
[self.view addSubview:txtView];
[txtView release];
另一种选择是获取 webview 并在 webview 中加载您的内容.
Another option can be take a webview and load your contents in webview.
这篇关于UITextView 未加载/显示大文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!