Hi,
Im still trying to get to grips with iOS, getting better every day, but keep finding little problems I cannot find solutions to.
The problem I have right now is when I first start an app with a text field on it, the keyboard immediately shows. This is easy to replicate in 4.5.3 by creating a new stack, pop a multi line field onto it, then change the settings to compile for iOS and then simulate. Every time the app starts, the keyboard pops up. Is there an easy way to fix so it doesnt happen?
The second problem is to dismiss the keyboard I just tap anywhere else on the screen, which works until I add a backdrop that covers the whole screen and then it seems impossible to dismiss the keyboard. Again, its easy enough to simulate, just use the file -> import as control -> image file to pop an image in, send it to the back and simulate, the keyboard will no longer dismiss. Is this a known issue?
Thanks
Keyboard issues
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Keyboard issues
Hi Andy,
the keyboard will pop up everytime a field is "opened" so you could try this:
Best
Klaus
the keyboard will pop up everytime a field is "opened" so you could try this:
Code: Select all
on preopencard
## or "opencard if that doesn't work
focus on nothing
end preopencard
Klaus
Re: Keyboard issues
Hi Andy, Klaus,
I also had that problem and had to work around it. What I did was to set the traversalOn of a button that has a lower layer number that all fields. This button happened to be in a group so I had to set the traversalOn of the group also. Be shure to turn showFiocusBorder off for the button. In the property inspector for the button (or the group if the button is in a group) go to Size and Position and change the layer of the button/group to a number lower then the lowest number of your text fields that have traversalOn, i.e. are focusable and ready for text entry.
Now when a card is opened the focus goes to that button, instead of the field. And no keybord pops up until the user clicks into the field.
I tried "focus on nothing" in the preopencard handler, but it did not work in the simulator. Too bad, it would have been a much cleaner and obvious solution.
Kind regards
Bernd
I also had that problem and had to work around it. What I did was to set the traversalOn of a button that has a lower layer number that all fields. This button happened to be in a group so I had to set the traversalOn of the group also. Be shure to turn showFiocusBorder off for the button. In the property inspector for the button (or the group if the button is in a group) go to Size and Position and change the layer of the button/group to a number lower then the lowest number of your text fields that have traversalOn, i.e. are focusable and ready for text entry.
Now when a card is opened the focus goes to that button, instead of the field. And no keybord pops up until the user clicks into the field.
I tried "focus on nothing" in the preopencard handler, but it did not work in the simulator. Too bad, it would have been a much cleaner and obvious solution.
Kind regards
Bernd
Re: Keyboard issues
Thanks guys, that works.
Andy
Andy
Re: Keyboard issues
Just to update the thread about the other problem I had where you add an image that covers the whole screen and the keyboard cannot then be dismissed by tapping on the screen, this can also be fixed by adding a mouseup event to the image that switches focus to the button.
on mouseup
focus on button "btnFocus"
end mouseup
Likewise, if you have a keyboard up, adding the following to the field the keyboard is working with will make the keyboard disappear when someone presses the 'done' or return key on the keyboard.
on returnInField
focus on button "btnFocus"
end returnInField
I hope this helps someone else!
Andy
on mouseup
focus on button "btnFocus"
end mouseup
Likewise, if you have a keyboard up, adding the following to the field the keyboard is working with will make the keyboard disappear when someone presses the 'done' or return key on the keyboard.
on returnInField
focus on button "btnFocus"
end returnInField
I hope this helps someone else!
Andy