1

enter image description here每個continent.Each區域由線之間他們。我不知道是哪個佈局use.I需要設計相適應的佈局分開。我對點擊監聽器修復世界地圖佈局所有類型的screens.The圖像位置是固定的。自第二行必須填寫上最space.I我感覺很難設計layout.Please給你的建議對哪種類型的佈局是最好的設計這個屏幕。如何創建android系統

+0

使用線性佈局,並使用重量爲它.. – Piyush

回答

1

你可以使用這個XML文件...

<LinearLayout 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:background="#efefef" 
    android:orientation="vertical" 
    tools:context=".ComposeActivity" > 

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

    <LinearLayout 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="3" 
     android:orientation="vertical" > 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="3" 
      android:orientation="vertical" > 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="7" 
      android:orientation="horizontal" > 
     </LinearLayout> 
    </LinearLayout> 

    <LinearLayout 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="2" 
     android:orientation="vertical" > 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="7" 
      android:orientation="horizontal" > 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="3" 
      android:orientation="horizontal" > 
     </LinearLayout> 
    </LinearLayout> 

    <LinearLayout 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="5" 
     android:orientation="vertical" > 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight=".33" 
      android:orientation="vertical" > 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight=".33" 
      android:orientation="horizontal" > 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight=".33" 
      android:orientation="horizontal" > 
     </LinearLayout> 
    </LinearLayout> 
    </LinearLayout> 

</LinearLayout> 
1
<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:paddingBottom="@dimen/activity_vertical_margin" 
     android:paddingLeft="@dimen/activity_horizontal_margin" 
     android:paddingRight="@dimen/activity_horizontal_margin" 
     android:paddingTop="@dimen/activity_vertical_margin" 
     tools:context=".MainActivity" > 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:layout_alignParentTop="true" 
      android:layout_marginTop="15dp" 
      android:weightSum="3" 
      android:layout_marginBottom="15dp"> 

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

       <ImageView 
        android:id="@+id/imageView1" 
        android:layout_width="fill_parent" 
        android:layout_weight="1" 
        android:layout_height="wrap_content" 
        android:src="@drawable/ic_launcher" /> 

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

        <ImageView 
         android:id="@+id/imageView2" 
         android:layout_width="fill_parent" 
         android:layout_weight="1" 
         android:layout_height="fill_parent" 
         android:src="@drawable/ic_launcher" /> 

        <ImageView 
         android:id="@+id/imageView3" 
         android:layout_weight="1" 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent" 
         android:src="@drawable/ic_launcher" /> 

       </LinearLayout> 

      </LinearLayout> 

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

       <ImageView 
        android:id="@+id/imageView4" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:src="@drawable/ic_launcher" /> 

       <ImageView 
        android:id="@+id/imageView5" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:src="@drawable/ic_launcher" /> 

      </LinearLayout> 

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

       <ImageView 
        android:id="@+id/imageView6" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:src="@drawable/ic_launcher" /> 

       <ImageView 
        android:id="@+id/imageView7" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:src="@drawable/ic_launcher" /> 

       <ImageView 
        android:id="@+id/imageView8" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_weight="1" 
        android:src="@drawable/ic_launcher" /> 

      </LinearLayout> 

     </LinearLayout> 

    </RelativeLayout> 


just change your image into this