ITKeyword,专注技术干货聚合推荐

注册 | 登录

Preventing the Android soft keyboard from moving the view up in a Fragment?

itPublisher 分享于

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

 | 


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。