android 键盘遮挡解决办法

来源:互联网 发布:java岗位管理制度 编辑:程序博客网 时间:2024/05/22 04:55

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 0
原创粉丝点击