2016-12-30 1 views
0

내 응용 프로그램에서 사용자가 헤더 텍스트와 내용 텍스트를 입력 할 수있는 UI를 만들고 싶습니다. 그러나 내용 텍스트는 화면의 나머지 영역 전체를 채우고 'textBottomType'은 화면 하단에 있어야합니다. 어떻게 'textInputContent'가 전체 빈 화면 영역을 채울 수 있는지 확인할 수 있습니까? 나는 UI로 다른 것들을 시도했고, 아래는 나의 코드이다.전체 화면 영역을 TextInputLayout으로 채우기

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 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:id="@+id/content_user_view" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:showIn="@layout/activity_user_view"> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/textInputHeader" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:padding="2dp"> 
       <AutoCompleteTextView 
        android:id="@+id/textInputHeaderInformation" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Enter Your Header" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:id="@+id/textInputContent" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/textInputHeader" 
      android:padding="2dp"> 
      <EditText 
       android:id="@+id/textInputContentInformation" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Enter Your Content" 
       android:inputType="text" 
       android:layout_weight="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <LinearLayout android:orientation="horizontal" android:layout_marginTop="12dp" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@color/background1" 
      android:layout_below="@+id/textBottomType" 
      android:layout_alignParentStart="true"> 
      <ImageView android:src="@android:drawable/ic_popup_reminder" android:layout_margin="@dimen/card_margin" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 
      <TextView android:text="Important Information" 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:textAlignment="center" 
       android:textStyle="normal|bold" 
       android:textColor="@color/winter" 
       android:textSize="18sp" /> 
     </LinearLayout> 
</RelativeLayout> 

현재 Incorect보기 ... Current UI view

그리고 이것은 내가 내보기이 원하는 것입니다 ... Expected UI view

감사합니다,

IamHuM

답변

0

Edittext의 inputType 속성을 textMul로 설정합니다. tlLine :

android:inputType="textMultiLine" 
+0

변경된 내용은 다음과 같습니다. 이 문제는 '귀하의 콘텐츠 입력'아래의 텍스트가 한 줄짜리 텍스트이지만이 줄에 여러 줄의 텍스트를 입력하고 싶습니다. 어떻게하면 전체 화면이 내용 텍스트로 채워질 수 있도록 사용자가 여러 줄 텍스트를 입력하도록 허용 할 수 있습니다. – IamHuM

+0

기본 질문에 현재 UI 및 예상 UI에 대한 이미지를 추가했습니다. – IamHuM

+0

아래와 같이 코드를 수정했습니다. – IamHuM

0

아래와 같이 수정 된 코드입니다. 감사합니다. Vivek 빠른 응답.

 <EditText 
      android:id="@+id/textInputContentInformation" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:hint="Enter Your Notes Content" 
      android:inputType="text|textAutoComplete|textMultiLine|textLongMessage" 
      android:layout_weight="1" 
      android:maxLines="1000" 
      /> 
관련 문제