簡體   English   中英

鍵盤打開Android時,具有Edittext底部大小的Listvew減小

[英]Listvew with Edittext bottom size reduced on Keyboard open Android

打開鍵盤時,編輯文本大小有問題。 我有一個列表視圖,並在活動中編輯文本。 直到鍵盤打開為止,編輯文本的大小都可以。 鍵盤打開后,編輯文本的高度減小。

情況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>

重量確定了布局的高度。 因此,我刪除了除ListView之外的所有內容,以便覆蓋剩余的高度。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM