0

Hi all I have a window with two text fields and two buttons.When I'm on the second text field, the keyboard is in the way of the buttons. And thus, there is no way to press the buttons. I need to turn the device sideways and a 'done button' appears in my text field which, if clicked, will remove the keyboard. But in the future, I will be locking my app to portrait so I'm just wondering how to solve this issue. Is there a specific keyboard I can call which will have a button to remove the keyboard or anything like that? I'm working with titanium

user2363025
  • 6,365
  • 19
  • 48
  • 89
  • 3
    I suggest placing the View in a ScrollView. Then when the keyboard is shown for that view you can have the textfield scroll up so it is not covered by the keyboard. Follow this example http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present – DogCoffee Sep 14 '13 at 10:34
  • @Smick Thanks. That sorted it! – user2363025 Sep 14 '13 at 11:02
  • @Smick: Add it as an answer so that it will help others – Anand Sep 15 '13 at 02:38

2 Answers2

0

As suggested, in comments above.

By placing the View inside a ScrollView will allow you to achieve this result. Then when the keyboard is shown for that view you can have the textfield scroll up so it is not covered by the keyboard. Follow this example shown here:

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

Community
  • 1
  • 1
DogCoffee
  • 19,820
  • 10
  • 87
  • 120
0

If you don't want to use a scroll view, or want more control over the 'avoiding', use IHKeyboardAvoiding https://github.com/IdleHandsApps/IHKeyboardAvoiding

(its mine)

Fraser
  • 953
  • 11
  • 21