TechChain
TechChain

Reputation: 8944

Main view taking top space from scrollview?

I have made a ui in which i am showing some textfileds.I have added all textfields inside a mainview & added mainview under scrollview.But main view is always taking space from top.I have added

  self.automaticallyAdjustsScrollViewInsets = NO;

in scroll view .But that make scroll view static. Then the scroll view does not scroll.I am changing the contentSize of scrollview on when keyboard appears & disappears.

enter image description here

Upvotes: 1

Views: 114

Answers (3)

Reshmi Majumder
Reshmi Majumder

Reputation: 961

You can try :

Select ViewContoller in storyboard check a property in attribute Inspector "Adjust Scroll View Insets" untick that,in my case it worked .

Upvotes: 2

Badal Shah
Badal Shah

Reputation: 7602

Check you have not set properly constrain to your content view.

You have set height and width equal to scrollview but you need to set it respected to your Mainview.

Please set your constrain in this way. and Run your Viewcontroller again

enter image description here

Upvotes: 1

Dipen
Dipen

Reputation: 268

Use this. This is very useful one.

TPKeyboardAvoiding

Upvotes: -1

Related Questions