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