0


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?

Thorben
  • 17
  • 6

2 Answers2

1

Try this,

 [_textView setContentInset:UIEdgeInsetsMake(-15, 0, 5,0)]; // change as per your textview
karthika
  • 4,085
  • 3
  • 21
  • 23
  • Thanks karthika, I tried this too, but it has no influence to the text in my UITextView. The text is still positioned a few lines below the top of the UITextView in the iOS7.0, 4" retina simulator. – Thorben Oct 09 '13 at 14:27
0

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.

Community
  • 1
  • 1
  • 1
    Thanks I have used `self.edgesForExtendedLayout = UIRectEdgeNone;`for my UIViewControllers. The text content in the UIView is now shown at the top. – Thorben Oct 09 '13 at 14:04