I have this layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:minWidth="100dp" >
<TextView
android:id="@+id/txt_what_way"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="4"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="3">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_launcher"/>
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="3">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_launcher"/>
</LinearLayout>
</LinearLayout>
I want that it looks like:
- TextView - 40% of width, Layout with ImageView - 30% of widht, Layout with - - ImageView - 30% of width.
However, the output is:
TextViewImageViewImageView----------------free space----------------------------------
This should do it ,although it would distort your image.
Use android:weightSum="10" in your case and Use android:background in place of android:src , replace your xml file with this
You might get distorted image