user2734823
user2734823

Reputation: 157

Android linear layout help needed (two columns)

I am new to android and need some help creating xml code which reproduces the layout seen in this picture:

enter image description here

I would show what I have attempted so far but I just erased my entire xml file in frustration.

Thank you in advance!

Upvotes: 1

Views: 189

Answers (2)

anjaneya
anjaneya

Reputation: 708

    <LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:weightSum="5"
      android:orientation="horizontal">

    <ImageView
     android:layout_width="0dp"
     android:layout_height="wrap_content"
     android:weight="4"/>

    <LinearLayout
      android:layout_width="0dp"
      android:layout_height="match_parent"
      android:weight="1"
      android:orientation="vertical">

    <Button
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>

    <ImageView
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>

    <ImageView
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>

    </LinearLayout>
 </LinearLayout>

Upvotes: 0

josephus
josephus

Reputation: 8304

<LinearLayout
  ... width=fill_parent, height=fill_parent
  ... weightSum=5
  ... orientation=horizontal>

  <LinearLayout
     ... width=0dip, height=fill_parent
     ... weight=4/>
  <LinearLayout
     ... width=0dip, height=fill_parent
     ... weight=1/>
</LinearLayout>

Upvotes: 2

Related Questions