Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextfield to be displayed on top of Keyboard - Beginner

I have textboxes. When i click on it, the Keyboard pops out. but, since the uitextfield is located some where below, it gets covered when the keyboard pops out. (The keyboard gets displayed above the text field, so the user is unable to see it).

I need a way to move the textfield up so that the user can see it. The iPhone facebook app has a workaround, they shrink the UIComponents on the view to display the textfield on top, so it doesn't cover from the keyboard.

Can someone point me to a tutorial or sample code to start with?

like image 542
shajem Avatar asked Feb 26 '12 14:02

shajem


People also ask

How do I get the onscreen keyboard in Swift?

If the keyboard is going to appear, we use the keyboard height + 20 (the bottom constraint).

What is Uitextfield?

An object that displays an editable text area in your interface.

What is a text field on Iphone?

A text field is a rectangular area in which people enter or edit small, specific pieces of text.


1 Answers

OPTION-1: You can refer to this code which has been accepted as answer in this following link:

How to make a UITextField move up when keyboard is present?

This will surely help you and give you your required solution.

OPTION-2: Also here is an ready made TUTORIAL:

http://www.edumobile.org/iphone/iphone-programming-tutorials/scrollview-example-in-iphone/

I think you would be surely helped by this one

OPTION-3: You can refer to this:

http://www.iphonesampleapps.com/2009/12/adjust-uitextfield-hidden-behind-keyboard-with-uiscrollview/

OPTION-4: Apple Documentation:

https://developer.apple.com/library/ios/#DOCUMENTATION/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html

Hope this helps you.

like image 141
Parth Bhatt Avatar answered Oct 03 '22 07:10

Parth Bhatt