UITextView not loading / not showing large text?

I have a simple UITextView on my login screen where I need to display the Terms and Conditions. I have a very large text in the Terms. In the interface builder, I added text to the UITextView. In the interface builder, the text is displayed correctly. But when I run the application, the UITextView is empty. If I give small text in a UItextView, it is processed correctly, but the large / large text is not displayed.

Can anybody help me.


Here is the code.

- (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. } 
+1
source share
3 answers

I also ran into the same problem and I decided to take it with an IBOutlet UITextView and set the value in 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]; 

Another option can be taken by webview and upload your content to webview.

0
source

Create this UITextView programmatically

 UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(AsYouNeed)]; [textView setFont: [UIFont fontWithName:@"YourFontName" size:YourSize]]; textView.text = @"test my font size"; [textview setUserInteractionEnabled:TRUE]; [self.view addSubview:textView]; [textView release]; 

Maybe this is useful for you :)

0
source

Thank you all .. I found a solution that works now. below is the answer ... By providing the text programmatically .... and

 termsofUseText.text = @"MY LARGE TEXT GOES HERE...... " termsOfUseText.scrollEnabled = YES; termsOfUseText.userInteractionEnabled = YES; termsOfUseText.editable = NO; 
0
source

Source: https://habr.com/ru/post/972269/


All Articles