Android 聊天列表 软键盘遮挡住输入框所在容器的问题
来源:互联网 发布:域名快速备案 编辑:程序博客网 时间:2024/06/05 15:21
很多朋友说在androidManifest.xml中的activity中设置 android:windowSoftInputMode="adjustUnspecified|stateHidden" ,我之前设置了没有反应,所以我把去掉了,用的默认的。
布局文件:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/main_bg_color" > <include android:id="@+id/top_title" layout="@layout/title" /> <LinearLayout android:id="@+id/ll_bottom" style="@style/ll_hw_wf_orientation_vertical" android:layout_alignParentBottom="true" android:background="@color/transparent" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="40dip" android:background="@color/title_color" android:padding="5dip" > <ImageView android:id="@+id/img_add" style="@style/height_w_width_w" android:layout_marginLeft="5dip" android:scaleType="center" android:src="@drawable/spread_icon" /> <TextView android:id="@+id/tv_voice" style="@style/tv_content_black_hfwf_sizeFive" android:layout_marginLeft="10dip" android:layout_marginRight="5dip" android:layout_toRightOf="@+id/img_add" android:background="@color/white" android:gravity="center" android:text="按住说话" android:visibility="gone" /> <Button android:id="@+id/btn_send" android:layout_width="60dip" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:layout_marginRight="5dip" android:background="@drawable/send_msg_bg" android:text="发布" android:textColor="@color/black" android:textSize="@dimen/five" /> <EditText android:id="@+id/ed_info" style="@style/tv_content_black_hfwf_sizeFive" android:layout_centerVertical="true" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:layout_toLeftOf="@+id/btn_send" android:layout_toRightOf="@+id/img_add" android:background="@color/white" android:hint="请输入内容" android:paddingLeft="5dip" /> </RelativeLayout> <GridView android:id="@+id/gridView" android:layout_width="fill_parent" android:layout_height="80dip" android:cacheColorHint="@color/transparent" android:gravity="center" android:horizontalSpacing="10dip" android:listSelector="@color/transparent" android:numColumns="2" android:padding="5dip" android:stretchMode="columnWidth" android:visibility="gone" /> </LinearLayout> <ListView android:id="@+id/listView" style="@style/height_f_width_f" android:layout_above="@+id/ll_bottom" android:layout_below="@+id/top_title" android:cacheColorHint="@color/transparent" android:divider="@null" android:fadingEdge="none" android:listSelector="@color/transparent" /></RelativeLayout>布局文件中的style样式说明:height_f_width_f 表示android:layout_width="fill_parent" android:layout_height="fill_parent";
height_w_width_w 表示android:layout_width="wrap_content" android:layout_height="wrap_content"
ll_hw_wf_orientation_vertical 表示LinearLayout控件的android:layout_width="fill_parent" android:layout_width="wrap_content" android:orientation="vertical"
这是布局文件,这个布局文件实现的效果就是正常的,请看图:
再来看一张效果为软键盘遮挡住输入框所在容器的图片:
出现这个效果的原因:ListView控件设置了android:scrollbars="none" 或者ListView控件的高度并没有设置填充(fill_parent/match_parent)而是用的是自适应(wrap_content),所以出现了这个效果。出现的具体原因还在查找中,先放出来和大家分享,如果大家有知道原因的,欢迎留言分享。
0 0
- Android 聊天列表 软键盘遮挡住输入框所在容器的问题
- android软键盘遮挡输入框问题
- Android WebView 软键盘遮挡输入框问题的解决方法
- Android弹出软键盘遮挡输入框问题.
- Android 解决在页面底部置输入框,软键盘遮挡部分输入框的问题
- Android软键盘遮挡输入框解决方法
- Android Webview 软键盘遮挡输入框
- Android WebView加载页面的输入框被软键盘遮挡的问题
- Android横屏时,软键盘全屏显示,遮挡住输入框
- Android软键盘遮挡问题
- 当用软键盘输入时输入框被键盘遮挡的问题
- ios解决软键盘遮挡输入框问题
- js解决软键盘遮挡输入框问题
- Android WebView中软键盘会遮挡输入框相关问题
- Android WebView中软键盘会遮挡输入框相关问题
- android webview 页面,输入框软键盘遮挡问题(滑动页面)
- Android WebView中软键盘会遮挡输入框相关问题
- Android WebView中软键盘会遮挡输入框相关问题
- 使用 viewport meta 标签在手机浏览器上控制布局
- Xwiki的简介
- 08-OS X系统中将control和command键互换
- 华为VRP V8,软件定义网络的梦幻平台
- android studio cannot resolve symbol R
- Android 聊天列表 软键盘遮挡住输入框所在容器的问题
- 别人创业的故事
- Java核心类库——IO原理和用法
- css hack全解,最齐全的ie css hack方式讲解
- .net中的域Area
- 将数据从PostgreSQL同步到Elasticsearch的经验总结
- 4-3-1 求和--1/n-println换行是对后一个输出起作用--减一个1/(n-1)加一个1/n
- JAVA实现AES加密
- 使用 viewport meta 标签在手机浏览器上控制布局