0

I have a UIView, where I have a UIScrollView and 6 UITextField had 2 UILabel. When I want to write something to UITextfield, which is low I have this problem:

enter image description here

The keyboard hidden UITextfields. When I set larger size of UIScrollView, nothing happens. How can I solve this problem?

Community
  • 1
  • 1
krata
  • 101
  • 10
  • 1
    You need to add all the controller on UIScrollView and then manage it with contentSize.. – iPatel Mar 28 '14 at 11:38
  • you can't! UIKeyboard display on the top of UIWindow. You should hide the keyboard first – LE SANG Mar 28 '14 at 11:43
  • you can't! UIKeyboard display on the top of UIWindow. you can resolve your problem ,look this https://github.com/michaeltyson/TPKeyboardAvoiding – Anupam Mar 28 '14 at 11:49
  • Duplicate question : http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present?rq=1 – aksh1t Mar 28 '14 at 12:02
  • Are you using tableView ? if , we can set content offset property to UItableView or use " TPKeyboardAvoiding " as per the below answer – Vineesh TP Mar 28 '14 at 12:09

2 Answers2

4

TPKeyboardAvoiding lib could be helpful here.

https://github.com/michaeltyson/TPKeyboardAvoiding

Avt
  • 16,927
  • 4
  • 52
  • 72
0

You have to take Scrollview first. Than add all textfields & labels into it.

Now while clicking on any textfield there is a delegate method calls named textFiledDidBeginEditing. You can set the ScrollView offset in it.

Hope this will help.

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70