-1

I want to display multiple uneven sized images side by side. Basically i want a structure like this. :

Check Here

Here is my code but It's coming top to bottom :

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



        <ImageView
            android:id="@+id/offerBanner1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true"
            android:src="@drawable/ic_offer_banner1"
            android:scaleType="fitCenter" />

        <ImageView
            android:id="@+id/offerBanner2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true"
            android:src="@drawable/ic_offer_banner2"
            android:scaleType="fitCenter" />


    </LinearLayout>

Any kind of help would be highly appreciated. Thanks

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

0

try this to get images side by side

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"> <!--horizontal here-->

    <ImageView
        android:id="@+id/offerBanner1"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:src="@drawable/ic_offer_banner1"
        android:scaleType="fitCenter" />

    <ImageView
        android:id="@+id/offerBanner2"
         android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:src="@drawable/ic_offer_banner2"
        android:scaleType="fitCenter" />

</LinearLayout>
rya
  • 1,417
  • 1
  • 16
  • 29