How to set an ImageView and two TextviewS to have the same height?

Posted by M.ES on Stack Overflow See other posts from Stack Overflow or by M.ES
Published on 2012-03-31T17:16:08Z Indexed on 2012/03/31 17:29 UTC
Read the original article Hit count: 180

Filed under:
|
|

I've got the following layout with one ImageView and 2 TextView, I would like them all to have the same height. However, the ImageView is always taking more than half of the screen. Any help is highly apreciated.

Here is the layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:orientation="vertical" >

<ImageView android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="0.4"
    android:src="@drawable/sprint" />
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="0.3"
    android:background="#555555"
    android:text="@string/hello" />
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="0.3"
    android:text="@string/hello" />

</LinearLayout>

© Stack Overflow or respective owner

Related posts about java

Related posts about Xml