0

사용자가 입력 할 양식이 있으며 양식의 마지막 항목은 여러 줄을 지원하는 EditText입니다.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> 

사용자가 EditText에 집중하면 화면 키보드를 수용하기 위해보기를 스크롤합니다. 내가하고 싶은 일은 자동 스크롤을 (select와 add new line에서) 강제적으로 제출 버튼을 항상 보도록 유지하는 것입니다.

답변

관련 문제