android软键盘不覆盖屏幕方法
16lz
2021-01-26
把顶级的layout替换成ScrollView,或者说在顶级的Layout上面再加一层ScrollView的封装。这样就会把软键盘和输入框一起滚动了,软键盘会一直处于底部。
在我们的LinearLayout布局外添加ScrollView
方法三示例:
由原来的:
<?xml version="1.0" encoding="utf-8"?>
android:layout_width="fill_parent"
android:layout_height="fill_parent">
......
改为:<?xml version="1.0" encoding="utf-8"?>
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="fill_parent"
android:layout_height="fill_parent">
......
在我们的LinearLayout布局外添加ScrollView
方法三示例:
由原来的:
<?xml version="1.0" encoding="utf-8"?>
android:layout_height="fill_parent">
......
改为:<?xml version="1.0" encoding="utf-8"?>
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_height="fill_parent">
......
更多相关文章
- 通知设置Android通知(Notification)示例
- Github-Client(ANDROID)开源之旅(二) ------ 浅析ActionBarSherkLoc
- android 权限封装(思路来至于RxPermissions)
- 解决打开Activity相应的edittext不弹出软键盘
- Android(安卓)EditText 禁止换行
- retrofit2+okhttp3+rxjava网络封装
- Android用户界面程序设计示例
- android监控SIM卡状态的广播示例代码
- 如何解决软键盘弹出引起的各种不适