UIViewController does not configure content inserts when showing another UIViewController (inside a UINavigationController)

I have a navigation controller whose root is a view controller (call it first). This first view controller has a button that, when clicked, shows another view controller (call it second). This second view controller has a single UITextView that spans the entire view.

In the storyboard, the sample text in the UITextView correctly starts below (but not below) in the title bar. In other words, its content inserts are set correctly.

However, when I launch the application and I click the First View Controller button to show the second view controller, the text is under the title. Inserts of text view content are zero.

Why isn't the top inset of the text view content automatically adjusting to account for the title?

I've created a "minimal" app that shows the problem: https://github.com/redcurry/TestContentInsets .

Note. I am using Xamarin, but I am assuming the same problem occurs on iOS (I have not tested it).

+3


source to share


2 answers


In the second view controller, clear the Customize Scroll Inserts check box. See Screenshot



0


source


You may be looking for this

Your view starts with a navigationController control. You just need to install it.



enter image description here

0


source







All Articles