2

我是 Android 编程新手,想了解以下行为。我有一个简单的布局,带有一个 Edittext 和一个按钮,如下所示。当手机处于纵向模式时,输入超过10行时,不会隐藏键盘后面的按钮。但是,当手机处于横向模式时,输入大约3-4行时,会将按钮隐藏在键盘后面。谁能帮我解释一下,为什么会这样。什么是解决方案,所以行为在不同方向上是一致的?

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <EditText
        android:id="@+id/et"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:gravity="left|center"
        android:imeOptions="flagNoExtractUi|flagNoFullscreen"
        android:inputType="textMultiLine|textNoSuggestions"
        android:maxLength="480"
        android:maxLines="8"
        android:scrollbars="vertical|horizontal"
        android:singleLine="false"
        android:textAppearance="?android:attr/textAppearanceMedium" />   
    <Button
        android:id="@+id/btn"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dip"
        android:layout_marginTop="10dip"
        android:text="ENTER"
        android:layout_below="@+id/et"
        android:textColor="@android:color/white" />
</RelativeLayout>
4

0 回答 0