开发者

How can I keep my UIAlertView above the keyboard? It will only jump up then return to default

开发者 https://www.devze.com 2023-03-02 14:58 出处:网络
I created a uiAlertView that contains textFields for an iPad.This means that in landscape mode, the alert is covered up by the keyboard.I searched for a开发者_如何转开发 solution and I came up with

I created a uiAlertView that contains textFields for an iPad. This means that in landscape mode, the alert is covered up by the keyboard. I searched for a开发者_如何转开发 solution and I came up with

alert.transform = CGAffineTransformTranslate(alert.transform, 0.0, 150.0);

However, all this seems to do is make the alert "jump" up to 150 and then come back down to its default place. How can I make the alert stay up high without jumping back down?

Thanks!


You can set the text field's keyboardAppearance to UIKeyboardAppearanceAlert.

aTextField.keyboardAppearance = UIKeyboardAppearanceAlert;

There are a few other tricks to putting textfields on UIAlertView. See my blog post on the subject.

0

精彩评论

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