开发者

Displaying the keyboard above the toolbar?

开发者 https://www.devze.com 2023-02-13 05:49 出处:网络
I have an ipad app with a single textfield. When the user clicks in the textfield, I want the keyboard to come up without moving or covering the toolbar at the bottom of the screen. The c开发者_JAVA百

I have an ipad app with a single textfield. When the user clicks in the textfield, I want the keyboard to come up without moving or covering the toolbar at the bottom of the screen. The c开发者_JAVA百科losest I've come to this is the following:

[textField setInputAccessoryView:toolBar];

There are two problems with this.

  1. The keyboard pushes the toolbar up when it appears.
  2. When the keyboard is dismissed, it takes the toolbar with it!

If I could fix 2, then I could probably live with 1, but I'd rather find a solution to both. Thanks!

EDIT: I give up on fixing 1 based on TomSwift's answer, but can someone please tell me if there is a way to push up the toolbar when they keyboard appears and then drop the toolbar back in place when the keyboard disappears???? THANKS!


I'm pretty sure you dont have this option. In iOS the keyboard position is controlled by the OS - you can get notifications of where it is but I dont think you can control where it goes. What you're asking for is to slide the keyboard in and keep going until it's "above" your toolbar at the bottom of the screen.

Have you seen any other apps that do this?


The toolbar disappears upon hiding because it has been added to another view, and therefore removed from its original view. You'll need to re-add it as you initially did.

0

精彩评论

暂无评论...
验证码 换一张
取 消