listview嵌套多个edittext,点击edittext,软键盘挡住界面的问题

taozi321 2013-12-05 05:22:25
我界面有一个listview和一个textview组成。每一个item是由一个testview和一个edittext组成。
布局如下:
<?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="fill_parent"
android:background="@drawable/main_bg"
android:orientation="vertical" >

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:orientation="horizontal" >

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:text="新增一项:"
android:textColor="#000000"
android:textSize="16sp" />
</RelativeLayout>
<ListView
android:id="@+id/main_listview"
android:layout_width="fill_parent"
android:layout_height="500dp" />
<ScrollView
android:id="@+id/device_addlabel_scrollview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbarSize="12dip"
android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb"
android:scrollbarTrackVertical="@drawable/scrollbar_vertical_track" >

<TextView
android:id="@+id/device_binding_write_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="0dp"
android:textColor="#000"
android:textSize="12sp" />
</ScrollView>

</LinearLayout>
listitem布局如下
<?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="fill_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/device_property_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="属性"
android:textColor="#000"
android:textSize="14sp" />

<EditText
android:id="@+id/device_property_edittext"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="afa"
android:padding="6dp"
android:textSize="14sp" />
</LinearLayout>
该activity在manifest中设置android:windowSoftInputMode="adjustPan"
现在当点击edittext的时候,第一次可以将界面往上顶,显示出要输入数据的edittext,输入之后再次点击点击该edittext,软键盘就会遮挡住edittext,求帮忙啊
...全文
840 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
first5 2015-10-26
  • 打赏
  • 举报
回复
我也有遇到,不过是 顶上去了,然后页面下不来了,就一直卡在上面,有遇到这个问题的吗,求解决
牧歌ing 2015-10-26
  • 打赏
  • 举报
回复
手机屏幕小这个问题避免不了,不过你可以再在屏幕的顶部出现一个文本框,这个文本框和软键盘一样处于最顶端,这样你输入的东西就可以看到了,大部分app也是这么做的
suyoung21 2015-10-09
  • 打赏
  • 举报
回复
不知你们解决掉这个问题没?我现在也是listview里嵌套edittext,第一次选中,界面是上移了,但将输入法上的向下按钮一点隐藏,再次点击原edittext,输入法会出来,但界面不会上移,遮住了点击的edittext
房顶上的爱 2014-08-22
  • 打赏
  • 举报
回复
我之前也加了android:windowSoftInputMode="adjustPan",第一次弹出时不挡界面,第二次挡了,然后在清单文件里 去掉,就好了,我的是这样的
ccxbb 2014-06-19
  • 打赏
  • 举报
回复
遇到同样问题,顶。
w382285328 2014-06-03
  • 打赏
  • 举报
回复
解决了没 也遇到同样的问题
Jeek_Cool 2014-05-30
  • 打赏
  • 举报
回复
在EditText属性下尝试下这个属性:android:imeOptions=" "
EasyJD 2014-05-30
  • 打赏
  • 举报
回复
引用 4 楼 lm__q 的回复:
android:screenOrientation="portrait"
错了是这个 android:windowSoftInputMode="adjustPan"
EasyJD 2014-05-30
  • 打赏
  • 举报
回复
android:screenOrientation="portrait"
逍遥笑 2014-05-28
  • 打赏
  • 举报
回复
这个你搜索一下,在弹出键盘 的时候,将整个界面向上拉,就可以不回被遮住
中才德创 2014-05-28
  • 打赏
  • 举报
回复
屏幕小,难免出现这个问题。是google的bug。
w382285328 2014-05-27
  • 打赏
  • 举报
回复
问题解决了吗?我也遇到了 郁闷

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧