TareK Khoury
TareK Khoury

Reputation: 13031

Android Layout design help!

i am learning android development, and i am kinda confused when it comes to designing the application, please advise on what is the best way to reach the layout in the image below?

------------------
|        *       |
|  Icon  *  Icon |
|        *       |
| ************** |
|        *       |
|  Icon  *  Icon |
|        *       | 
------------------

The starts in the layout indicates a Photoshop line image.

I hope you get the picture since i`m not allowed to post images yet.

Thanks.

Upvotes: 1

Views: 310

Answers (1)

Paresh Mayani
Paresh Mayani

Reputation: 128448

You can create the same kind of layout using below code. For creating this layout, you can use android:layout_weight="1" with android:layout_width="0dp" to have all views with equal layouts if they lies in same layout. In your case, you have 2 images in the same row, so mention these attributes while taking imageviews in layout.

For your case, you can use:

<LinearLayout
   android:orientation="vertical">

  <LinearLayout
   android:orientation="horizontal">
        <ImageView
             android:layout_width="0dp"
             android:layout_weight="1"/>   
        <ImageView
             android:layout_width="0dp"
             android:layout_weight="1"/>   
  </LinearLayout>

  <LinearLayout
   android:orientation="horizontal">
         <ImageView
             android:layout_width="0dp"
             android:layout_weight="1"/>   

        <ImageView
             android:layout_width="0dp"
             android:layout_weight="1"/>   

  </LinearLayout>

</LinearLayout>

Upvotes: 3

Related Questions