关于android编写类似于微信QQ聊天界面,点击底部输入框之后内容被顶出的问题处理

AndroidManifest.xml文件中界面对应的activity里加入

android:windowSoftInputMode="stateVisible|adjustResize" 配置之后压缩listview

注意:此处可能设置android:windowSoftInputMode="stateVisible|adjustResize"无效,我的原因是因为去掉了listview滚动条(android:scrollbars="none")导致,去掉该属性完美解决

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent" >    <LinearLayout        android:id="@+id/ll_top"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:background="#F86630" >        <TextView            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:gravity="center"            android:text="top"            android:textColor="#FFFFFF"            android:textSize="20dp" />    </LinearLayout>    <LinearLayout        android:id="@+id/ll_bottom"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_alignParentBottom="true"        android:background="#77DA83"        android:orientation="horizontal" >        <EditText            android:layout_width="0dp"            android:layout_height="wrap_content"            android:layout_weight="4" />        <Button            android:layout_width="0dp"            android:layout_height="wrap_content"            android:layout_weight="1"            android:text="ok" />    </LinearLayout>    <ListView        android:id="@+id/lv_list"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_above="@id/ll_bottom"        android:layout_below="@id/ll_top" >    </ListView></RelativeLayout>



更多相关文章

  1. Android学习笔记-界面和数据存储以及一些零碎知识点
  2. 【Android(安卓)界面效果14】RelativeLayout里常用的位置属性
  3. Android用户界面 UI组件--AdapterView及其子类(二) AdapterViewA
  4. Android界面布局基本知识简述
  5. android键盘弹出之后界面整体上移,顶出去了
  6. 1.4 android——UI之 UI界面属性用法与注意点汇总
  7. Android(安卓)在界面中显示以及输入文本信息 TextView和EditText
  8. Android(安卓)5.1状态栏背景色定制 在Launcher3界面显示透明,在其
  9. Android(安卓)获取界面上的元素

随机推荐

  1. Android四大核心——Activity
  2. [gitbook] Android框架分析系列之Android
  3. Android执行linux外部命令
  4. Android如何快速入门
  5. Android(安卓)GestureDetector手势监听
  6. 去除警告 Android(安卓)NDK: WARNING: AP
  7. 解决 Android(安卓)模拟器 无法上网问题
  8. Android系统源码极速搜索引擎(OpenGrok)
  9. Android开发环境的安装 Eclipse
  10. Android(安卓)好用插件 / 实用依赖(及时