简体   繁体   中英

Show UITextField above Keyboard

I am using the following tutorial to show the uitextfield above the keyboard at all times: http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-keeping-content-from-underneath-the-keyboard/

But the problem is the uitextfield only gets shown above the keyboard if the person starts typing into the field, but not if the cursor is in the textfield.

How can I change it so that the uitextfield gets shown above the keyboard once the cursor is in the UITextField?

Thanks

Check UITextFieldDelegate and select appropriate method.

In this tutorial they use textFieldDidBeginEditing method to assign active textfield. As it clear from method name, it executes when someone start typing in text field.

I downloaded the sample code and work just fine for me. The only thing that I figured you could misunderstood is in the case the keyboard it's already below the textField, in these cases the view will not scroll.

I hope this helps. If it's not this that you want, please tell me more about it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM