2011-08-06 3 views
0

여기에 더 긴 linearLayout3 안에 LL_BtnR 레이아웃이 있습니다. LL_BtnR의 중력은 '중심'으로 설정되지만 왼쪽 구석에 나타납니다.레이아웃 요소가 가운데에 있지 않습니다 ... 왜?

linearLayout3 센터의 콘텐츠를 얻으려면 어떻게해야할까요?

enter image description here

감사합니다!

<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:background="@layout/backrep" android:orientation="vertical" android:layout_gravity="center"> 
     <LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/linearLayout2" android:background="@drawable/spell_frame" android:layout_marginBottom="10px" android:layout_marginTop="5px" android:layout_gravity="center"> 
      <TextView android:text="TextView" android:textColor="#FFFFFF" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="7px" android:paddingLeft="15px" android:typeface="sans"></TextView> 
     </LinearLayout> 


     <LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/linearLayout3" android:layout_marginLeft="5px" android:layout_marginRight="5px" android:layout_gravity="center"> 

      <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5px" android:layout_marginBottom="5px" android:layout_marginRight="5px" android:layout_marginTop="5px" android:id="@+id/LL_BtnR" android:onClick="onButtonClick" android:layout_gravity="center"> 
       <ImageView android:layout_height="wrap_content" android:id="@+id/ImageView01" android:src="@drawable/button_left" android:layout_width="wrap_content"></ImageView> 
       <FrameLayout android:id="@+id/frameLayout1" android:layout_height="match_parent" android:background="@layout/butrep" android:layout_width="40px" android:layout_gravity="center"> 
        <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:src="@drawable/bun_r" android:id="@+id/imageView2" android:layout_gravity="center"></ImageView> 
       </FrameLayout> 
       <ImageView android:layout_height="wrap_content" android:id="@+id/imageView1" android:layout_width="wrap_content" android:src="@drawable/button_right"></ImageView> 
      </LinearLayout> 

     </LinearLayout> 

    </LinearLayout> 

답변

1

바깥 쪽을 향하는 LinearLayout의 중력을 가운데로 변경하십시오.

+0

완료 ... 동일하지 않으므로 아무 것도 변경되지 않습니다. – Roger

+0

이 레이아웃 파일에 대해 XML을 게시 할 수 있습니까? – PravinCG

+0

이 추가되었습니다. :) – Roger

관련 문제