2016-07-04 5 views
1

화면에 맞는 기본 레이아웃이 있습니다. 그러면 단추를 표시하기 위해 아래로 스크롤해야합니다. fillviewport를 제거하려고 시도했지만보기가 축소됩니다. 선형 레이아웃 wrap_content를 만들었고 동일한 작업을 수행했습니다. 뷰내 scrollView가 스크롤하지 않습니까?

<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" 
      android:layout_marginBottom="8dp" 
      android:layout_marginLeft="16dp" 
      android:layout_marginRight="16dp" 
      android:orientation="vertical"> 

<ScrollView 
    android:id="@+id/inner_scroll_view" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_above="@+id/detail_note_date_text" 
    android:fillViewport="true" 
    android:> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

      <EditText 
       android:id="@+id/detail_title_edit_text" 
       android:layout_width="match_parent" 
       android:layout_height="0dp" 
       android:layout_weight="8" 
       android:backgroundTint="@android:color/background_light" 
       android:hint="@string/title_hint" 
       android:inputType="textShortMessage" 
       android:textSize="24dp" 
       /> 

      <EditText 
       android:id="@+id/detail_note_edit_text" 
       android:layout_width="match_parent" 
       android:layout_height="0dp" 
       android:layout_weight="48" 
       android:gravity="top" 
       android:hint="@string/note_hint" 
       android:textSize="16dp" 
       /> 

      <RadioGroup 
       android:id="@+id/reminder_radio_group" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <RadioButton 
        android:id="@+id/radio_no_set_reminder" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="@string/radio_button_no_set_reminder"/> 

       <RadioButton 
        android:id="@+id/radio_set_reminder" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="@string/radio_button_set_reminder"/> 
      </RadioGroup> 
     </LinearLayout> 
     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"/> 
    </LinearLayout> 
</ScrollView> 

<TextView 
    android:id="@+id/detail_note_date_text" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_centerInParent="true" 
    android:layout_gravity="center" 
    android:layout_weight="2" 
    tools:text="@string/demo_date"/> 

+0

어떻게 보는가? 여기서 스크린 샷을 보낼 수 있습니까? –

답변

0

은 다음과 시도 붕괴 : 당신이 응용 프로그램을 실행할 때

<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" 
     android:layout_marginBottom="8dp" 
     android:layout_marginLeft="16dp" 
     android:layout_marginRight="16dp"> 

<ScrollView 
android:id="@+id/inner_scroll_view" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:layout_above="@+id/detail_note_date_text" 
> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

     <EditText 
      android:id="@+id/detail_title_edit_text" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:backgroundTint="@android:color/background_light" 
      android:hint="@string/title_hint" 
      android:inputType="textShortMessage" 
      android:textSize="24dp" 
      /> 

     <EditText 
      android:id="@+id/detail_note_edit_text" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:gravity="top" 
      android:hint="@string/note_hint" 
      android:textSize="16dp" 
      /> 

     <RadioGroup 
      android:id="@+id/reminder_radio_group" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <RadioButton 
       android:id="@+id/radio_no_set_reminder" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="@string/radio_button_no_set_reminder"/> 

      <RadioButton 
       android:id="@+id/radio_set_reminder" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="@string/radio_button_set_reminder"/> 
     </RadioGroup> 
    </LinearLayout> 
    <Button 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"/> 

</ScrollView> 

<TextView 
android:id="@+id/detail_note_date_text" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_alignParentBottom="true" 
android:layout_centerHorizontal="true" 
android:text="@string/demo_date"/> 

</RelativeLayout> 
+0

방금 ​​코드를 편집했습니다. 첫 번째 레이아웃 디자인을 올바르게 배우고 화면에서 벗어날 정도로 내용이 큰 경우에만보기가 스크롤됩니다. – Drv

+0

그런 식으로 작동하지만 editText 필드가 화면을 차지하게하고 싶습니다. 당신이 저를 도와 줄 수있는 방법이 있습니까? –

+0

edittext 키보드가 올바르게 열리면 위의 전체 레이아웃을 스크롤하고 싶습니까? – Drv

관련 문제