0

How to resize the EditText when the softkeyboard gets displayed? For compatibility reasons(different screen sizes and densities), can we resize the EditText to a value such that it is "20dp" above the softkeyboard or the whole screen becomes scrollable? Read many posts on SE about using nut they didn't work for me.

The main.xml file is below:

<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1.04" >
  <Button
            android:id="@+id/Save"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:layout_marginRight="15dp"
            android:layout_marginTop="16dp"
            android:layout_marginBottom="20dp"
            android:textColor="#ffffff"
            android:text="@string/SaveButton" />

        <EditText
            android:id="@+id/NoteTextBox"
            android:layout_width="fill_parent"
            android:layout_height="180dp"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/Save"
            android:layout_marginTop="20dp"
            android:ems="10"
            android:textColor="#ffffff"
            android:inputType="text"
            android:singleLine="false" >

            <requestFocus />

        </EditText>

    </RelativeLayout>
4

1 に答える 1

1

それを使用してみてandroid:imeOptions="flagNoExtractUi"くださいあなたを助けるかもしれません。あなたについての詳細はここでimeOptions読むことができます

それが役に立てば幸い

于 2012-05-28T08:16:15.267 に答える