2012-03-15 2 views
3

를 만드는 데 도움이 필요하지만 여기에 방법처럼 점점 할 수없는 것은 내보기 여기레이아웃을

enter image description here

하고있다 내 레이아웃 작성 용 코드

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#ffffff" 
    android:orientation="vertical" 
    android:weightSum="1"> 

    <TextView 
     android:id="@+id/app_title_view" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:gravity="center" 
     android:padding="5dp" 
     android:text="Stuffs on the go lite" 
     android:textColor="#000" 
     android:textSize="18dp" /> 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_below="@id/app_title_view" 
     android:orientation="horizontal" android:gravity="center"> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:orientation="vertical" 
      android:background="#29000000" 
      android:padding="10dp" android:weightSum="1"> 

      <TextView 
       android:id="@+id/all_stuff_view" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_weight="0.5" 
       android:background="#959686" 
       android:gravity="center" 
       android:padding="10dp" 
       android:text="All Stuffs" 
       android:textColor="#000" 
       android:textSize="16dp" /> 

      <TextView 
       android:layout_weight="0.5" 
       android:id="@+id/setting_view" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:background="#441244" 
       android:gravity="center" 
       android:padding="10dp" 
       android:text="Map" 
       android:textColor="#000" 
       android:textSize="16dp" 
       /> 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="fill_parent" android:layout_height="fill_parent" 
      android:orientation="vertical" android:background="#29000000" 
      android:padding="10dp" android:weightSum="1"> 

      <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" 
       android:orientation="horizontal" android:background="#92000000" android:layout_weight="0.5"> 

       <TextView android:id="@+id/setting_view" android:layout_width="fill_parent" 
        android:layout_height="fill_parent" android:layout_weight="0.5" 
        android:background="#441244" android:gravity="center" 
        android:padding="10dp" android:text="Memo" 
        android:textColor="#000" android:textSize="16dp" /> 

       <TextView android:id="@+id/all_stuff_view" android:layout_width="fill_parent" 
        android:layout_height="fill_parent" android:layout_weight="0.5" 
        android:background="#959686" android:gravity="center" 
        android:padding="10dp" android:text="Task" 
        android:textColor="#000" android:textSize="16dp" /> 
      </LinearLayout> 
      <TextView android:id="@+id/all_stuff_view" android:layout_width="fill_parent" 
       android:layout_height="fill_parent" android:layout_weight="0.5" 
       android:background="#959686" android:gravity="center" 
       android:padding="10dp" android:text="Reminder" 
       android:textColor="#000" android:textSize="16dp" /> 
      <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:background="#92000000"> 
      <TextView 
       android:id="@+id/all_stuff_view" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_weight="0.5" 
       android:background="#959686" 
       android:gravity="center" 
       android:padding="10dp" 
       android:text="Setting" 
       android:textColor="#000" 
       android:textSize="16dp" /> 
     </LinearLayout> 
     </LinearLayout> 

    </LinearLayout> 
</LinearLayout> 

귀하의 도움과 제안을 부탁드립니다

답변

0

업데이트 : 그냥 다음 레이아웃을 붙여 복사 스크린 샷 여기

을 제거하는 XML 레이아웃 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="#ffffff" 
android:orientation="vertical" > 

<TextView 
    android:layout_width="fill_parent" 
    android:layout_height="40dp" 
    android:background="#123456" 
    android:gravity="center" 
    android:text="this title" /> 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#ff0000" 
    android:orientation="vertical" 
    android:weightSum="2" > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:background="#00ff00" 
     android:orientation="horizontal" 
     android:weightSum="2" > 

     <LinearLayout 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" 
      android:background="#654321" > 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" 
      android:background="#0000ff" 
      android:orientation="vertical" 
      android:weightSum="2" > 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="0dp" 
       android:layout_weight="1" 
       android:background="#454545" 
       android:orientation="horizontal" 
       android:weightSum="2" > 

       <LinearLayout 
        android:layout_width="0dp" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:background="#143434" > 
       </LinearLayout> 

       <LinearLayout 
        android:layout_width="0dp" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:background="#564456" > 
       </LinearLayout> 
      </LinearLayout> 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="0dp" 
       android:layout_weight="1" 
       android:background="#765245" 
       android:orientation="horizontal" 
       android:weightSum="2" > 

       <LinearLayout 
        android:layout_width="0dp" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:background="#878987" > 
       </LinearLayout> 

       <LinearLayout 
        android:layout_width="0dp" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:background="#213556" > 
       </LinearLayout> 
      </LinearLayout> 
     </LinearLayout> 
    </LinearLayout> 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:background="#0000ff" 
     android:weightSum="2" > 

     <LinearLayout 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" 
      android:background="#675678" > 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" 
      android:background="#989763" > 
     </LinearLayout> 
    </LinearLayout> 
</LinearLayout> 

+0

완벽한 레이아웃 감사합니다. – Pratik

0

테이블 레이아웃 당신이 필요로하는대로 병합과 함께 사용하는 것이 좋습니다 생각합니다. 생각해보세요.

도움이 될 수 있기를 바랍니다.

+0

내가 함께 노력을 테이블하지만 행을 늘릴 수 없다 – Pratik

+0

이렇게 쉽게 ... weightsum과 함께 LinearLayouts를 사용하십시오. –

+0

코드를 확인하십시오. 이미 사용하고 있습니다. – Pratik

0

당신은

+0

RelativeLayout을 사용하지 않는 경우 유용 할 수 있습니다. http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-relative-layouts/ – AliSh

0

여기 당신의 XML 관리 할 수있는 LinearLayout 일부 RelativeLayout의를 사용할 수 있습니다

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

<RelativeLayout 
    android:id="@+id/titlelayout" 
    android:layout_width="fill_parent" 
    android:layout_height="50dp" 
    android:gravity="center_vertical" > 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:text="realplayer" /> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_centerVertical="true" 
     android:background="@drawable/arrow" /> 
</RelativeLayout> 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_below="@+id/titlelayout" 
    android:orientation="vertical" 
    android:weightSum="2" > 

    <LinearLayout 
     android:id="@+id/toplayout" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:weightSum="2" > 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" > 

      <TextView 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="playlists" /> 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" > 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:orientation="vertical" 
       android:weightSum="2" > 

       <LinearLayout 
        android:id="@+id/toprighttoplayout" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:weightSum="2" > 

        <LinearLayout 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:layout_weight="1" > 

         <TextView 
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent" 
          android:text="artist" /> 
        </LinearLayout> 

        <LinearLayout 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:layout_weight="1" > 

         <TextView 
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent" 
          android:text="Albums" /> 
        </LinearLayout> 
       </LinearLayout> 

       <LinearLayout 
        android:id="@+id/toprightbottomlayout" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:weightSum="2" > 

        <LinearLayout 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:layout_weight="1" > 

         <TextView 
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent" 
          android:text="genres" /> 
        </LinearLayout> 

        <LinearLayout 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:layout_weight="1" > 

         <TextView 
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent" 
          android:text="songs" /> 
        </LinearLayout> 
       </LinearLayout> 
      </LinearLayout> 
     </LinearLayout> 
    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/bottomlayout" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:weightSum="2" > 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" > 

      <TextView 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="videos" /> 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" > 

      <TextView 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="photos" /> 
     </LinearLayout> 
    </LinearLayout> 
</LinearLayout> 

0

다음과 같은 레이아웃이 작업을 수행 할 수 있습니다. 단순히 TextView 상자 위치를 찾을 항목을 찾으십시오.

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:weightSum="2"> 

    <!-- first half of screen --> 
    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:background="#DEB887"> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:weightSum="2"> 
      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_weight="1" 
       android:background="#1E90FF"> 

       <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Box-1"/> 

      </LinearLayout> 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_weight="1" 
       android:background="#FF69B4"> 

       <LinearLayout 
        android:orientation="vertical" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:weightSum="2"> 

        <LinearLayout 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:layout_weight="1" 
         android:background="#DEB887"> 

         <LinearLayout 
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent" 
          android:weightSum="2"> 
          <LinearLayout 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent" 
           android:layout_weight="1" 
           android:background="#8FBC8F"> 

           <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Box-2"/> 

          </LinearLayout> 

          <LinearLayout 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent" 
           android:layout_weight="1" 
           android:background="#F0E68C"> 

           <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Box-3"/> 

          </LinearLayout> 
         </LinearLayout> 

        </LinearLayout> 


        <LinearLayout 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:layout_weight="1" 
         android:background="#F5F5DC"> 

         <LinearLayout 
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent" 
          android:weightSum="2"> 
          <LinearLayout 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent" 
           android:layout_weight="1" 
           android:background="#F0E68C"> 

           <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Box-4"/> 

          </LinearLayout> 

          <LinearLayout 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent" 
           android:layout_weight="1" 
           android:background="#8FBC8F"> 

           <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Box-5"/> 

          </LinearLayout> 
         </LinearLayout> 

        </LinearLayout> 

       </LinearLayout> 

      </LinearLayout> 
     </LinearLayout> 

    </LinearLayout> 


    <!-- second half of screen --> 
    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:background="#F5F5DC"> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:weightSum="2"> 
      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_weight="1" 
       android:background="#FF69B4"> 

       <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Box-6"/> 

      </LinearLayout> 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_weight="1" 
       android:background="#1E90FF"> 

       <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Box-7"/> 

      </LinearLayout> 
     </LinearLayout> 

    </LinearLayout> 


</LinearLayout> 
0
HI I have generated this layout for example: 

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" > 

<TableLayout 
    android:id="@+id/tableLayout1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

    <TableRow 
     android:id="@+id/tableRow1" 
     android:layout_width="wrap_content" 
     android:background="#eee" 
     android:layout_height="wrap_content" > 
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:layout_gravity="center|center" 
android:gravity="center|center" 
android:orientation="vertical" > 
     <ImageView android:background="@drawable/ic_launcher" 
     android:layout_width="wrap_content" 

     android:layout_height="wrap_content" 
     /> 
     </LinearLayout> 
      <TableLayout 
    android:id="@+id/tableLayout1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 
    <TableRow 
     android:id="@+id/tableRow1" 
     android:layout_width="wrap_content" 
     android:layout_gravity="center|center" 
     android:background="#feedae" 
     android:layout_height="wrap_content" > 

     <ImageView android:background="@drawable/ic_launcher" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     /> 
     <ImageView android:background="@drawable/ic_launcher" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     /> 
     </TableRow> 
      <TableRow 
     android:id="@+id/tableRow1" 
     android:layout_width="wrap_content" 
     android:layout_gravity="center|center" 
     android:background="#feedae" 
     android:layout_height="wrap_content" > 

     <ImageView android:background="@drawable/ic_launcher" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     /> 
     <ImageView android:background="@drawable/ic_launcher" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     /> 
     </TableRow> 
    </TableLayout>  

    </TableRow> 

    <TableRow 
     android:id="@+id/tableRow3" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" > 
    </TableRow> 

    <TableRow 
     android:id="@+id/tableRow4" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" > 
    </TableRow> 
</TableLayout> 

관련 문제