java - RelativeLayout执行属性动画时弹出软键盘遮挡住布局里部分控件导致不可见
巴扎黑
巴扎黑 2017-04-18 10:02:22
0
1
607

问题描述:EditText为了不让软键盘挡住,监听了键盘弹起状态,键盘弹起时马上执行包裹EditText的RelativeLayout上升的动画,由于软键盘弹起速度很快,在动画开始前RelativeLayout的部分控件就被键盘遮挡住了,导致动画结束这些控件一直不可见。

属性动画:

ObjectAnimator animator = ObjectAnimator.ofFloat(container, "translationY", -mIvLoginBg.getMeasuredHeight()) .setDuration(200); animator.start();
巴扎黑
巴扎黑

répondre à tous (1)
大家讲道理

键盘弹出布局上移可以不需要用动画实现
在布局对应的activity中增加设置

android:windowSoftInputMode="stateHidden|adjustPan
    Derniers téléchargements
    Plus>
    effets Web
    Code source du site Web
    Matériel du site Web
    Modèle frontal
    À propos de nous Clause de non-responsabilité Sitemap
    Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!