安卓键盘弹出是底部布局整体上移实现
2016-12-20 14:45
399 查看
两种方案 1 在相关的activity的清单中 加入 android:windowSoftInputMode="adjustResize", 这个无关布局可以实现功能 2 ,在不需要配置上面清单文件的情况下,可以使用下面的方案 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.founder.demo.MainActivity"> <!--这里是实现的关键,加入之后底部布局才能上移 这里可以是listview ,GridView 这类可以滑动的控件--> <ScrollView android:id="@+id/layout_scroll" android:layout_width="match_parent" android:layout_height="match_parent"> </ScrollView> <Button android:id="@+id/btn_bottom" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" /> <RelativeLayout android:id="@+id/layout_bottom" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@+id/btn_bottom" android:background="#FFD8d8d8" android:clickable="true" android:padding="5dp"> <EditText android:id="@+id/edit" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="90dp" android:hint="请输入常用汉字" /> <EditText android:id="@+id/edit2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/edit" android:layout_marginRight="90dp" android:hint="请输入常用汉字" /> </RelativeLayout> </RelativeLayout>
相关文章推荐
- 实现view底部控件随着键盘的弹出而上移的效果
- Android软键盘弹出,界面布局整体上移
- Android 软键盘弹出时布局内指定内容上移实现及问题解决
- (转)Android 软键盘弹出时布局内指定内容上移实现及问题解决
- Android layout实现输入法弹出后,布局整体上移
- Android 软键盘弹出时布局内指定内容上移实现及问题解决
- 解决安卓上底部使用fixed布局,键盘弹出后fixed部分的内容挡住form表单的情况
- AJ学IOS(18)UI之QQ聊天布局_键盘通知实现自动弹出隐藏_自动回复
- IOS 实现键盘弹出视图上移功能
- RelativeLayout 布局底部的EditText会被弹出的键盘遮挡
- Android软键盘弹出,界面整体上移的问题【转】
- 猫猫学IOS(十八)UI之QQ聊天布局_键盘通知实现自动弹出隐藏_自动回复
- 通过修改自动布局的约束实现键盘弹出后view上推
- android中隐藏与显示软键盘及不自动弹出键盘及软键盘将布局顶上去的实现方法
- Android软键盘弹出,界面整体上移的问题
- 猫猫学IOS(十八)UI之QQ聊天布局_键盘通知实现自动弹出隐藏_自动回复
- Android软键盘弹出,界面整体上移的问题
- [Google Android] RelativeLayout 布局底部的EditText会被弹出的键盘遮挡
- Android底部菜单布局+PopupWindows实现弹出菜单功能(初级篇)
- android 软键盘弹出,布局没有整体向上顶问题