Android keyboard slide animation

老子叫甜甜 提交于 2019-12-07 22:55:23

问题


I have little (read: no) experience with animations in Android, but wanted to implement an animation for when the keyboard appears. Effectively, it would appear that the entire activity was sliding upwards (like the keyboard was below the activity and pushed it upwards), as opposed to only moving up so far as the selected EditText.

Does anyone know how to do this?


回答1:


An app receives no notification of when a keyboard appears, and the android framework itself is responsible for either sliding the app or laying it out again. So customization isn't really possible. Which is probably a good thing- a keyboard is a separate app, and having written one I wouldn't want to even try to write the keyboard half of such an animation, we'd never get it to look right with all the various ways the app could do it.

The closest you'll get is to specify the fields to pan rather than resize when the keyboard is opened.



来源:https://stackoverflow.com/questions/18316564/android-keyboard-slide-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!