1

다음과 같은 XML 레이아웃이 있습니다. TExt View 다음에는 여러 개의 확인란과 단추가 있습니다. 선형 레이아웃에 모든 확인란을 동봉하고 스크롤보기를 설정했습니다. 스크롤을하면 내 버튼을 볼 수 없습니다. 어떻게해야합니까? 스크롤 뷰 의 조건은 스크롤 뷰에 대해 하나의 childview 아이 뷰의 5 월이 있어야 있습니다XML 레이아웃 - 스크롤 후 표시되는 버튼

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 


    <TextView /> 

    <ScrollView 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fillViewport="true" 
     android:orientation="vertical" > 

     <LinearLayout> 

      <CheckBox /> 

      <CheckBox /> 

      <CheckBox/> 

      <CheckBox/> 

      <CheckBox/> 

      <CheckBox/> 

      <CheckBox/> 

      <CheckBox/> 

      <CheckBox /> 

      <CheckBox/> 

      <CheckBox /> 
     </LinearLayout> 
    </ScrollView> 

    <Button 

    </Button> 

</LinearLayout> 
+1

질문 제목과 설명이 맞지 않습니까? 이상한 –

+0

미안, 그 오전 5시와 나는 잠에 관하여있다. 지적을 위해 고마워한다. – chitranna

+0

좋은 밤 나의 친애하는 친구, 잠 잘. –

답변

1

당신이 사용보기 와이트가 버튼을 표시 할 경우 5 월 서브 아이가

를 볼 포함 개념

<LinearLayout 
     <TextView 
    <ScrollView 
    <LinearLayout 
     <CheckBox 
     <CheckBox 
     <CheckBox 
     <CheckBox 
     . 



     <CheckBox 
    LinearLayout> 
    ScrollView> 
     <Button 
android:layout_weight="1" 

    LinearLayout > 
+0

괜찮습니다.하지만 이렇게하면 문제가 생깁니다. 아래로 스크롤하면 내 버튼이 표시되지 않습니다. 또한 많은 체크 박스를 가지고 있습니다. – chitranna

+0

ok 그것은 안드로이드 디자인에 대한 연습이 필요하다는 것을 의미합니다. – Sandy09

+0

예, 한 달에서 이렇게하고 있습니다 – chitranna

0

당신이 .. 더 나은 솔루션에 대한 사용자 RelativeLayout의 또는 FrameLayout이에 이있는 상대 레이아웃

를 사용하여 코드
<?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 


     <Button 
      android:id="@+id/relative_button" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
android:text="hello one" 
      > 
     </Button> 

     <ScrollView 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_above="@id/relative_button" 
      > 

     <LinearLayout> 

       <CheckBox /> 

       <CheckBox /> 

       <CheckBox/> 

       <CheckBox/> 

       <CheckBox/> 

       <CheckBox/> 

       <CheckBox/> 

       <CheckBox/> 

       <CheckBox /> 

       <CheckBox/> 

       <CheckBox /> 
      </LinearLayout> 
     </ScrollView> 

    </RelativeLayout> 
0

다음 코드를 사용해보십시오. Button을 맨 아래에 정렬하고 Button 위에 체크 상자가 포함 된 LinearLayout을 정렬해야합니다. 나는이 코드를 시도했고 그것은 나를 위해 일한다.

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

    <TextView 
     android:id="@+id/textView" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:text="ABC" /> 

    <ScrollView 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/textView" 
     android:layout_above="@+id/button" 
     android:orientation="vertical" > 

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

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" /> 
     </LinearLayout> 
    </ScrollView> 

    <Button 
     android:id="@+id/button" 
     android:layout_centerHorizontal="true" 
     android:layout_alignParentBottom="true" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" /> 

</RelativeLayout>