问题
I'm using a UISplitViewController, with a view that has a UITextView as the master view, but the text does not load until I rotate the ipad twice.
Logging when the app starts shows that the text view is available and the text inside it (which is defined in the nib file) is also loaded properly.
What am I doing wrong?
回答1:
It seems like I've found the limit to how many characters can be initially loaded into UITextView in a UIPopoverController (for portrait mode in UISplitViewController). The maximum number of characters is 621.
I thought it weird that if I override the text view in viewDidLoad with
self.textView.text = @"hello";
it would work, but loading the text from the nib as is didn't. Through some trial and error, it seems like 621 is the maximum number characters before the text view doesn't show upon initial load.
Using a UIWebView and loading the content in code fixes this.
来源:https://stackoverflow.com/questions/4617618/uitextview-not-showing-text-until-i-rotate-it