2011-12-23 2 views
0

머리글, 이미지 및 스크롤 텍스트 본문을 사용하여 선형 레이아웃을 만들려고합니다. 어떤 이유로 ScrollView는 헤더와 이미지가 종종 겹치는 것처럼 많은 공간을 차지하는 것처럼 보입니다. 각 개체에 가중치를 지정하려고 시도했지만 아무 것도 변경하지 않습니다.스크롤보기 보관하지 않음

여기에 나는 또한 (위 참조) 자신의 선형 레이아웃 내부의 텍스트 본문을 퍼팅 시도하지만 avial에있는 내 선형 레이아웃

<LinearLayout android:id="@+id/gamedescriptionlayout" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:orientation="vertical" 
      android:background="@drawable/backdrop9" 
      android:visibility="visible" 
      android:layout_marginBottom="20dp" 
      android:layout_marginTop="20dp" 
      android:layout_marginLeft="20dp" 
      android:layout_marginRight="20dp" 
      android:layout_gravity="center"> 

<TextView android:id="@+id/DescHeader" 
      android:layout_height="wrap_content"  
      android:layout_width="fill_parent" 
      android:layout_marginBottom="10dp" 
      android:layout_marginTop="10dp" 
      android:layout_marginLeft="10dp" 
      android:layout_marginRight="10dp" 
      android:gravity="center_horizontal" 
      android:textColor="#000000" 
      android:text="Level 1" 
      android:textSize="25dp" 
      android:layout_weight="1"/> 

<ImageView android:id="@+id/DescImage" 
      android:layout_height="wrap_content"  
      android:layout_width="fill_parent" 
      android:layout_below="@id/DescHeader" 
      android:gravity="center" 
      android:src = "@drawable/wall" 
      android:layout_weight="1"/> 

<ScrollView android:id="@+id/DescScroll" 
      android:layout_height="wrap_content"  
      android:layout_width="fill_parent" 
      android:layout_marginBottom="10dp" 
      android:layout_marginTop="10dp" 
      android:layout_marginLeft="10dp" 
      android:layout_marginRight="10dp" 
      android:layout_weight="1"> 

<LinearLayout android:id="@+id/DescContainer" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content"> 
<TextView android:id="@+id/DescBody" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:textColor="#000000" 
       android:text="HelloWorld LALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALA"/> 
</LinearLayout> 
</ScrollView> 

</LinearLayout> 

입니다.

답변

1

이 시도 :

<LinearLayout android:id="@+id/gamedescriptionlayout" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:orientation="vertical" 
      android:background="@drawable/backdrop9" 
      android:visibility="visible" 
      android:layout_marginBottom="20dp" 
      android:layout_marginTop="20dp" 
      android:layout_marginLeft="20dp" 
      android:layout_marginRight="20dp" 
      android:layout_gravity="center"> 

<TextView android:id="@+id/DescHeader" 
      android:layout_height="wrap_content"  
      android:layout_width="fill_parent" 
      android:layout_marginBottom="10dp" 
      android:layout_marginTop="10dp" 
      android:layout_marginLeft="10dp" 
      android:layout_marginRight="10dp" 
      android:gravity="center_horizontal" 
      android:textColor="#000000" 
      android:text="Level 1" 
      android:textSize="25dp" 
      android:layout_weight="0"/> 

<ImageView android:id="@+id/DescImage" 
      android:layout_height="wrap_content"  
      android:layout_width="fill_parent" 
      android:layout_below="@id/DescHeader" 
      android:gravity="center" 
      android:src = "@drawable/wall" 
      android:layout_weight="0"/> 

<ScrollView android:id="@+id/DescScroll" 
      android:layout_height="0dp"  
      android:layout_width="fill_parent" 
      android:layout_marginBottom="10dp" 
      android:layout_marginTop="10dp" 
      android:layout_marginLeft="10dp" 
      android:layout_marginRight="10dp" 
      android:layout_weight="1"> 

<LinearLayout android:id="@+id/DescContainer" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content"> 
<TextView android:id="@+id/DescBody" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:textColor="#000000" 
       android:text="HelloWorld LALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALALA"/> 
</LinearLayout> 
</ScrollView> 

</LinearLayout> 

그것은 지금 잘해야합니다!

+0

우수함을 고마워요 ^^ – Jack

0

변화

android:layout_below="@id/DescHeader" 

android:layout_below="@id/DescImage"