当edittext具有焦点时,Listview没有滚动条

时间:2014-11-13 12:53:45

标签: android listview android-edittext focus

我有一个listview和一个edittext,它们在垂直线性布局上顺序保持,在对话框布局中权重值为0.9到0.1。当我点击edittext键盘时出现并且布局移动到顶部但listview滚动条不会改变。因此我看不到listview的上层项目。我该如何解决?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
xmlns:fontawesometext="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:orientation="vertical"
android:scrollbars="vertical" >

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_margin="5dp"
    android:layout_weight="0.9"
    android:gravity="center" >

    <ListView
        android:id="@+id/listPMs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:divider="@null"
        android:dividerHeight="0dp"
        android:fadeScrollbars="false"
        android:scrollbars="vertical"
        android:transcriptMode="alwaysScroll" >
    </ListView>
</RelativeLayout>

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_margin="5dp"
    android:layout_weight="0.1"
    android:gravity="center" >

    <com.beardedhen.androidbootstrap.BootstrapEditText
        android:id="@+id/editPMAddMessage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="2dp"
        android:hint="@string/hintEnterMessage"
        android:imeOptions="actionSend"
        android:inputType="text"
        android:singleLine="true"
        bootstrapbutton:be_roundedCorners="true"
        bootstrapbutton:be_state="primary" />
</RelativeLayout>

1 个答案:

答案 0 :(得分:0)

尝试添加清单:

<activity
    ...
    android:windowSoftInputMode="adjustPan" >
</activity>

请参阅此链接:https://stackoverflow.com/a/21293762/3864698

相关问题