Reputation: 658
I have a TextView in my xib file.
After I assign text for it, it doesn't show the text till I double click it, and actually change the selection of the text:
Before double click:
After double click:
After changing selection size:
Do you have any idea, how to show text from the beginning?
Thanks
Upvotes: 5
Views: 3876
Reputation: 10329
In my case text was long and it was trimming from end. I was setting text first then font and colour. I Set font first then text. It works for me.
Upvotes: 0
Reputation: 7100
I had a similar bug, but it happened when I made the text unselectable. Once I made it selectable again(checked in nib), it fixed the text again. While this isn't a solution to this bug (unless making it unselectable also fixes your problem), hopefully it will help others.
Upvotes: 2
Reputation: 658
We found the solution. This situation happens, when you try to update the txt before the view is visible.
We override the function viewDidAppear, and did this code:
// To fix the bug of not showing text in textView
self.txtViewShowDetails.text = nil;
self.txtViewShowDetails.text = self.mediaItem.mediaDescription;
[self.txtViewShowDetails setContentOffset:CGPointZero];
If the view is animated, or inside animated controlView, we have to call the viewDidAppear after animation finished.
Upvotes: 9
Reputation: 1145
think you have set TextView custom font in IB .so you need to set custom font in code.Please set system font in IB and check in both device
TextView.font=[UIFont fontWithName:@"HelveticaNeue-Medium" size:17.0];
Upvotes: 0