Preventing the Android soft keyboard from moving the view up in a Fragment?
2021腾讯云限时秒杀,爆款1核2G云服务器298元/3年!(领取2860元代金券),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1062
2021阿里云最低价产品入口+领取代金券(老用户3折起),
入口地址:https://www.aliyun.com/minisite/goods
I have an activity with four tabs and every tab is implemented as a fragment. In one of these tabs I would like to prevent the soft keyboard from pushing up the view, while the keyboard should still push the views up in the other fragments. Does anybody know how to achieve this?
I cannot use the activity's windowSoftInputMode flag, because that would prevent it for the whole activity with all four fragments.
android view keyboard android-fragments|
this question edited Apr 4 '13 at 10:25 asked Apr 4 '13 at 10:09 Apfelsaft 3,299 2 14 33
|
1 Answers
1
Try to change flag dynamically
Use the following to change the softInputMode for an Activity in your tab click listener.
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
this answer answered Apr 19 '16 at 8:40 Kirill Shalnov 1,509 1 9 17
|
相关阅读排行
- 1Android 开发之view的几种布局方式及实践
- 2Android游戏开发学习(6)--处理VIew触屏MOVE和UP事件
- 3OpenGL ES Tutorial for Android – Part I – Setting up the view