android 键盘遮挡解决办法

论坛 期权论坛 脚本     
匿名网站用户   2020-12-21 08:35   11   0

android的键盘遮挡比较常见,常见的方式就是使用代码动态改变,
其实没必要那么麻烦,只需几个步骤就可以了
这样就可以了
windowSoftInputMode=”adjustResize”

但是如果设置了沉浸式标题,还需要在布局文件的根节点上加上即可
android:fitsSystemWindows=”true”

很多人需要代码算的原因是因为根本没有了解,所以才出现各种的代码算法

题外话,推荐一款很好用的沉浸式标题栏控件
compile ‘com.readystatesoftware.systembartint:systembartint:1.0.4’

//启用沉浸式标题栏,并改变颜色
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setTintColor(getResources().getColor(R.color.system_bg));
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:1136255
帖子:227251
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP