在键盘打开的Android上,Listvew的Edittext底部尺寸减小

在键盘打开的Android上,Listvew的Edittext底部尺寸减小,android,android-layout,android-listview,keyboard,android-edittext,Android,Android Layout,Android Listview,Keyboard,Android Edittext,当键盘打开时,我有编辑文本大小的问题。 我有一个列表视图和编辑活动中的文本。在键盘打开之前,编辑文本大小是正常的。键盘打开后,编辑文本高度降低 案例1:没有键盘 案例2:带键盘 我的布局代码是: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_par

当键盘打开时,我有编辑文本大小的问题。 我有一个列表视图和编辑活动中的文本。在键盘打开之前,编辑文本大小是正常的。键盘打开后,编辑文本高度降低

案例1:没有键盘

案例2:带键盘

我的布局代码是:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/screenBackGroundColor"
    android:orientation="vertical" >

        <LinearLayout
            android:id="@+id/linearLayoutMain"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@color/screenBackGroundColor"
            android:orientation="vertical"
            android:weightSum="10" >

            <ListView
                android:id="@+id/listView"
                android:layout_width="fill_parent"
                android:layout_height="0dp"
                android:layout_weight="8.8"
                android:clipToPadding="false"
                android:dividerHeight="0dp"
                android:fadeScrollbars="false"
                android:scrollbarAlwaysDrawVerticalTrack="true"
                android:scrollbarSize="80.0dip"
                android:scrollbars="vertical"
                android:stackFromBottom="true"
                android:transcriptMode="normal" />

            <EditText
                android:id="@+id/editTextBarcode"
                android:layout_width="fill_parent"
                android:layout_height="0dp"
                android:layout_weight="1.2"
                android:hint="Scan Product"
                android:inputType="text" />
        </LinearLayout>

    </LinearLayout>

我已经尝试过的: 1.在maianifest文件中调整PAN。

尝试以下操作:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<LinearLayout
    android:id="@+id/linearLayoutMain"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/listView"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:clipToPadding="false"
        android:dividerHeight="0dp"
        android:fadeScrollbars="false"
        android:scrollbarAlwaysDrawVerticalTrack="true"
        android:scrollbarSize="80.0dip"
        android:scrollbars="vertical"
        android:stackFromBottom="true"
        android:transcriptMode="normal" />

    <EditText
        android:id="@+id/editTextBarcode"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:hint="Scan Product"
        android:inputType="text" />
</LinearLayout>

权重固定布局的高度。所以我删除了它们,除了
列表视图
,这样它就覆盖了剩余的高度。

试试这个:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<LinearLayout
    android:id="@+id/linearLayoutMain"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/listView"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:clipToPadding="false"
        android:dividerHeight="0dp"
        android:fadeScrollbars="false"
        android:scrollbarAlwaysDrawVerticalTrack="true"
        android:scrollbarSize="80.0dip"
        android:scrollbars="vertical"
        android:stackFromBottom="true"
        android:transcriptMode="normal" />

    <EditText
        android:id="@+id/editTextBarcode"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:hint="Scan Product"
        android:inputType="text" />
</LinearLayout>


权重固定布局的高度。所以我删除了它们,除了
列表视图
,这样它就覆盖了剩余的高度。

你试过
android:layout\u height=“wrap\u content”吗
无需为
编辑文本提供权重
?感谢andro的工作,但现在编辑文本不在屏幕底部,而我需要底部的编辑文本。由于
权重
(1.2),它将始终占据屏幕的12%。。。尝试增加
编辑文本的
权重
。您是否尝试过
android:layout\u height=“wrap\u content”
,但没有给出
编辑文本的权重?感谢andro的工作,但现在编辑文本不在屏幕底部,而我需要底部的编辑文本。因为
权重
(1.2),它将始终占据你屏幕的12%。。。尝试增加
编辑文本的
权重