Android EditText强制提交按钮显示在屏幕上

Android EditText强制提交按钮显示在屏幕上,android,android-layout,android-edittext,android-scrollview,Android,Android Layout,Android Edittext,Android Scrollview,我有一个表单供用户填写,表单的最后一项是支持多行的EditText <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_par

我有一个表单供用户填写,表单的最后一项是支持多行的EditText

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".ContactUs.ContactUs">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:orientation="vertical"
        android:paddingBottom="@dimen/baseline_margin_unit"
        android:paddingLeft="@dimen/baseline_margin_unit"
        android:paddingRight="@dimen/baseline_margin_unit">

        <LinearLayout
            android:id="@+id/contact_details"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:orientation="vertical">

        </LinearLayout>

        <com.rengwuxian.materialedittext.MaterialEditText
            android:id="@+id/name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/contact_us_name"
            android:inputType="textPersonName"
            app:floatingLabel="normal"
            app:floatingLabelText="@string/contact_us_name" />

        <com.rengwuxian.materialedittext.MaterialEditText
            android:id="@+id/phone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/contact_us_phone_number"
            android:inputType="phone"
            app:floatingLabel="normal"
            app:floatingLabelText="@string/contact_us_phone_number" />

        <com.rengwuxian.materialedittext.MaterialEditText
            android:id="@+id/email"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/contact_us_email"
            android:inputType="textEmailAddress"
            app:floatingLabel="normal"
            app:floatingLabelText="@string/contact_us_email" />

        <com.rengwuxian.materialedittext.MaterialEditText
            android:id="@+id/message"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/contact_us_message"
            app:floatingLabel="normal"
            app:floatingLabelText="@string/contact_us_message" />

        <Button
            android:id="@+id/submit_email"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:text="@string/contact_us_send" />

    </LinearLayout>
</ScrollView>

当用户关注编辑文本时,它会向上滚动视图以适应屏幕键盘。我想做的是强制自动滚动(在“选择并添加新行”上),使“提交”按钮始终处于可见状态。

您看了吗

所以我的答案是将这些行添加到您的Android清单中

<activity
    android:windowSoftInputMode="adjustResize">
</activity>

您是否尝试将android:isScrollContainer=“false”添加到您的滚动视图中?