Android键盘幻灯片动画 [英] Android keyboard slide animation

查看:99
本文介绍了Android键盘幻灯片动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Android动画的经验很少(阅读:没有),但是想在键盘出现时实现动画.实际上,似乎整个活动都在向上滑动(就像键盘在活动下面,然后将其向上推),而不是仅向上移动到选定的EditText.

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.

有人知道该怎么做吗?

推荐答案

应用没有收到有关何时出现键盘的通知,而android框架本身负责滑动应用或重新布局.因此,真正不可能进行定制.这可能是一件好事-键盘是一个单独的应用程序,编写了一个我甚至不想尝试将键盘动画制作成一半的应用程序,我们永远无法使它以各种方式正确显示该应用程序可以做到.

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.

这篇关于Android键盘幻灯片动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆