1. 遇到这种情况我们首先到网上搜一圈,大概情况是需要设置<activity/>

    android:windowSoftInputMode="adjustResize" ,按照以上属性设置了,问题依然存在没有解决。

  2. 通过反复试验,得出结论布局文件的layout_weight权重为影响软盘覆盖edittext。成功的xml文件如下:
  3. <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#f4f6f5"
    android:orientation="vertical" > <!-- head bar -->
    <include layout="@layout/include_head_bar" /> <ListView
    android:id="@+id/listview"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:layout_marginLeft="10.0dip"
    android:layout_marginRight="10.0dip"
    android:layout_marginTop="10.0dip"
    android:cacheColorHint="#00000000"
    android:divider="@null"
    android:dividerHeight="5dp"
    android:scrollbars="none" /> <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="5" > <RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="5dp" > <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="#f5f5f5" > <ImageButton
    android:id="@+id/btnVoice"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="#00000000"
    android:paddingLeft="5dp"
    android:src="@drawable/voice" /> <EditText
    android:id="@+id/txtContent"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="left"
    android:layout_marginLeft="5dp"
    android:layout_weight="1"
    android:background="@drawable/shape_consult_search"
    android:completionThreshold="1"
    android:hint="输入内容"
    android:paddingLeft="8dp"
    android:textColor="#000000"
    android:textColorHint="#c2c2c2"
    android:textCursorDrawable="@null" /> <ImageButton
    android:id="@+id/btnPic"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="5dp"
    android:background="#00000000"
    android:src="@drawable/pic" /> <Button
    android:id="@+id/btnConsult"
    android:layout_width="wrap_content"
    android:layout_height="40dp"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:background="@drawable/shape_consult_top_btn_press"
    android:text="发送"
    android:textColor="#ffffff" />
    </LinearLayout>
    </RelativeLayout>
    </LinearLayout> </LinearLayout>

    效果图:

  4. 经过反复测试,还得出另一解决方案。需要将权重比较大的组件放到相对布局文件中,请看xml布局文件
  5. <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:background="#e9e9e9"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:orientation="vertical" > <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:background="#f0f0f0"
    android:gravity="center_vertical" > <TextView
    android:id="@+id/return_back"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:drawableLeft="@drawable/return_back"
    android:gravity="center|center_vertical"
    android:paddingLeft="15dp"
    android:text="@string/return_back"
    android:textColor="#20bf63"
    android:textSize="22sp" /> <TextView
    android:layout_width="0dip"
    android:layout_height="match_parent"
    android:layout_weight="2"
    android:gravity="center|center_vertical"
    android:text="@string/zx_tit"
    android:textColor="#000000"
    android:textSize="22sp" /> <TextView
    android:layout_width="40dp"
    android:layout_height="match_parent"
    android:gravity="center_vertical"
    android:singleLine="true" />
    </LinearLayout> <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#ffffff"
    android:orientation="vertical"
    android:paddingBottom="15dp"
    android:paddingLeft="15dp"
    android:paddingRight="15dp"
    android:paddingTop="10dp" > <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" > <TextView
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_gravity="left"
    android:layout_weight="1"
    android:text="@string/zx_name"
    android:textColor="#8b8b8b"
    android:textSize="18sp" /> <TextView
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_alignParentRight="true"
    android:layout_gravity="right"
    android:layout_weight="1"
    android:gravity="right"
    android:text="@string/zx_time"
    android:textColor="#8b8b8b"
    android:textSize="18sp" />
    </LinearLayout> <TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:singleLine="true"
    android:text="@string/zx_text"
    android:textColor="#000000"
    android:textSize="18sp" />
    </LinearLayout> <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:layout_weight="1" > <RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" > <ListView
    android:id="@+id/listview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10.0dip"
    android:layout_marginRight="10.0dip"
    android:layout_marginTop="10.0dip"
    android:cacheColorHint="#00000000"
    android:divider="@null"
    android:dividerHeight="5dp" /> <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="#f5f5f5" > <EditText
    android:id="@+id/txtContent"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="left"
    android:layout_marginLeft="5dp"
    android:layout_weight="1"
    android:background="@drawable/shape_consult_search"
    android:completionThreshold="1"
    android:hint="输入内容"
    android:paddingLeft="8dp"
    android:textColor="#000000"
    android:textColorHint="#c2c2c2"
    android:textCursorDrawable="@null" /> <Button
    android:id="@+id/btnConsult"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:background="@drawable/shape_consult_top_btn_press"
    android:text="发送"
    android:textColor="#ffffff" />
    </LinearLayout>
    </RelativeLayout>
    </LinearLayout> </LinearLayout>

    我们首先分析下这个布局文件:由三个linearlayout组成,其中前两个layout的高度肯定可以确定其高度,第三个layout比较复杂,包含一个 listView  relativelayout ,listview

  6. 中的内容是动态的,也就是说高度不定,内容不定;而且还有下边[发送]必须在屏幕的底端显示;假如我们把listview提到独立的layout中,当我们点击edittext输入内容时,就会被
  7. 软盘挡住。
  8. 另还需注意,具体问题具体分析。

解决位于底端Edittext 输入时被软盘遮盖的更多相关文章

  1. 【移动开发】EditText输入字数限制总结(包括中文输入内存溢出的解决方法)

    限定EditText输入个数的解决方案很多,但是一般主要考虑两点,也就是处理两件事:(1)不同语言字符(英文.中文等)处理方式(2)输入字符达到数目后,是否仍然允许用户输入 第一点,涉及的东东其实蛮多 ...

  2. Android EditText输入字数限制总结(包含中文输入内存溢出的解决方法)

    转载请注明,大飞:http://blog.csdn.net/rflyee/article/details/38856539 限定EditText输入个数的解决方式非常多,可是一般主要考虑两点.也就是处 ...

  3. 基于JQuery实现滚动到页面底端时自动加载更多信息

    基于JQuery实现滚动到页面底端时自动加载更多信息 关键代码: 代码如下: var stop=true; $(window).scroll(function(){ totalheight = par ...

  4. 解决edittext输入多行可以滑动的问题

    解决edittext输入多行可以滑动的问题  Java代码:   public class ScrollEditLayout extends ScrollView { public ScrollEdi ...

  5. 关于Office软件中Word输入时卡顿无反应的解决办法!

    最近在安装office2013时遇到了这样一个问题,就是在激活office之后,打开Word输入内容时十分卡顿.也是狂搜网上各种办法,有说改注册表的,也有说在office选项里设置什么输入法的,全试了 ...

  6. Android-------ListView列表中获取EditText输入的值

    最近项目的购物车中用列表中包含了留言功能, 需要获取EditText输入的内容,当购买多件商品时,就有点棘手了. 经过查资料解决了这个功能,并写了一个案例: 效果图: 可以在商品数据用一个字段来管理留 ...

  7. android 之EditText输入检測

    近期开发一个功能的时候发生一个故事,其情节例如以下: 功能事实上不复杂,当中须要一个EditText来获取用户输入的信息.于是,我做了一个Dialog来显示我的输入界面(代码例如以下): mAlert ...

  8. Android 实现限制EditText输入文字的数量

    前段时间比较忙 没来的及时分享出来.需求是这样的要求用户只能输入12个字符或者6位中文的数据:作为一个菜鸟遇到这样的问题第一反应就是 Android:maxLength="12"这 ...

  9. 解决虚拟机linux端mysql数据库无法远程访问

    解决虚拟机linux端mysql数据库无法远程访问 1. 在控制台执行 mysql -u root -p mysql,CentOS系统提示输入数据库root用户的密码,输入完成后即进入mysql控制台 ...

随机推荐

  1. C语言写猜拳游戏中遇到的函数循环小问题

    各位可能在初学C语言的时候都有写过猜拳游戏.但在写猜拳的函数时,避免不了会使用循环. 当函数被套在一个循环中的时候,你的计分变量可能就会被重置为函数体里的初始值.那么怎么解决这个问题? 其实很简单,你 ...

  2. Cassandra笔记--2. 安装

    1. 从apache官网下载Cassandra,我用的版本是2.1.8.压缩包解压,这里的目录是D:\cassandra\apache-cassandra-2.1.8 2. 配置环境变量  添加环境变 ...

  3. GO函数倒叙输出

    package main import "fmt" func main(){ rec() } func rec(i int){ { return } rec(i+) fmt.Pri ...

  4. Intent系列讲解---Intent简介以及相关属性

    一.Intent简介 Intent中文是"意图,意向",它是Android中四大组件通讯的纽带,Intent负责对应用中一次操作的动作.动作涉及数据.附加数据进行描述,Androi ...

  5. dom4j解析xml字符串

    import java.util.Iterator; import java.util.List; import org.dom4j.Document; import org.dom4j.Docume ...

  6. Altium Designer规则

    1.PCB规则 是PCB设计中至关重要的一个环节:保证PCB符合电气要求.机械加工(精度)要求:为自动布局.布线和部分手动布局.布线操作提供依据 为规则检查提供依据,PCB编辑期间,AD会实时地进行一 ...

  7. USART笔记 基于STM32F107VCT6

    USART   通用同步异步收发器 通用同步异步收发器(USART)提供了一种灵活的方法与使用工业标准NRZ异步串行数据格式的外部设备之间进行全双工数据交换.USART利用分数波特率发生器提供宽范围的 ...

  8. bzoj1178

    题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1178 看ppt http://wenku.baidu.com/link?url=dJv6LNm ...

  9. Qt Creator中,include路径包含过程(或如何找到对应的头文件)

    Qt Creator中,include路径包含过程(或如何找到对应的头文件) 利用Qt Creator开发程序时,需要包含利用#include来添加头文件. 大家都知道,#include <&g ...

  10. LDAP协议介绍

    LDAP协议基础概念  1. 从用途上阐述LDAP,它是一个存储静态相关信息的服务,适合"一次记录多次读取".经常使用LDAP服务存储的信息: 公司的物理设备信息(如打印机,它的I ...