Text added not at top of UITextView in iOS7
I created a UITexView control with a given size and then assigned a larger text to the UITextView.text property. With the iOS 6 Simulator all works fine and the Text begins at the top row of the UITextView control. The iOS7 simulator seems to have some empty lines at top, before the text is shown.
path = NSBundle.mainBundle.pathForResource(filename_and_extension[0], ofType:filename_and_extension[1])
stored_text = NSData.dataWithContentsOfFile(path)
@text_view.text = stored_text.to_str
@text_view.font = @text_view.font.fontWithSize(16.0)
Scrolling the text is possible in both versions (IOS6, iOS7). What could I do to start the text at the top of the UITextView in IOS7?
When you move from iOS6 to iOS7 All the subviews goes up by 20px, So for this you need to set up the Autosizing and iOS6/7 Deltas in the size inspector. If you have any problem see answer of aryaxt here
iOS 7 - Status bar overlaps the view
Hope that help.
尝试这个,
[_textView setContentInset:UIEdgeInsetsMake(-15, 0, 5,0)]; // change as per your textview
链接地址: http://www.djcxy.com/p/90330.html