1

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

TechChain
  • 7,104
  • 20
  • 81
  • 193

3 Answers3

2

You can try :

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

Reshmi Majumder
  • 941
  • 4
  • 14
1

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

Badal Shah
  • 7,255
  • 2
  • 27
  • 59
-1

Use this. This is very useful one.

TPKeyboardAvoiding

EI Captain v2.0
  • 21,360
  • 10
  • 76
  • 103
Dipen
  • 268
  • 1
  • 14