How to remove top padding for text in UITextView Swift

I have an unusual problem. First I have a Nav Controller, and as one page, I have a view controller with a top bar for the back button. I added uiview and uitextview. Then I make all the necessary restrictions after starting up and see the top addition for the text in the text representation of about ~ 60 pixels. And I really don't know how to remove it. I already tried 1)

textViewUserInput.contentInset = UIEdgeInsetsMake(-50, 5, 5, 5); 

it works, but the -50 value for the top insert is not suitable for different devices and orientations

2)

 textViewUserInput.textContainerInset = UIEdgeInsetsZero; textViewUserInput.textContainer.lineFragmentPadding = 0; 

nothing changes

+5
source share
1 answer

In Main.storyboard, select your view controller that has a UITextView, and under the attribute inspector tab, clear the "Configure Scroll Inserts" checkbox. I had the same issue and it worked for me.

+8
source

All Articles