Why is my text view full of unwanted space? Extra lines not in code. Screenshots

喜夏-厌秋 提交于 2019-12-11 02:34:03

问题


I have a programatically populated storyboard text view.

[textView setFont:[UIFont boldSystemFontOfSize:11.0f]];

    textView.text = @"Why oh why is this happening to me?! This seems like a pretty absurd problem to be having.";

This is how the text box loads. The text box is created between the image you see at the top and the two images you see at the bottom and it fills the whole space in-between.

How the text box looks if I scroll up (and how I want it to appear). It seems like there are a bunch of unwanted lines populating the text box before my text?!

So I have tried fixing the height and width of the text box using constraints, I have tried stopping the view scrolling and I have tried setting the content insert parameter of the text box. None of these things helped.

Anyone got any suggestions as to why this is happening?

I'm not sure if this is related, but the only change to this view controller recently has been making the navigation bar translucent.


回答1:


See this question and answer

You need to select the parent view controller and unselect the 'Adjust Scroll View Insets'

:o)



来源:https://stackoverflow.com/questions/19680786/why-is-my-text-view-full-of-unwanted-space-extra-lines-not-in-code-screenshots

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!