Search code examples
iphonecocoa-touchios4uiscrollview

How to add scrollview to the normal UIView in iPhone SDK?


In my iPhone app, I have a registration form. The registration form contains many textfields.

The textField near the bottom of the view get hidden when the keyboard comes up and even I am not able to scroll. How can I get around this issue?

Can it be possible by using Scrollview? If Yes, how should I add it?


Solution

  • You can add the scrollView to the UIView, thorough IB or code.

    Through code you can add as [self.view addSubView:scView];

    Before that you need to add all the fields, labels and TextFields to the ScrollView and set tags to the fields for the reference.

    And one more thing,you need to move the UIView to some what up, when you select the Textfields to enter some text, by setting the 'y' index of the view to negative value.