我有一個ImageView和2個TextView的下面的佈局,我希望他們都有相同的高度。但是,ImageView總是佔用超過一半的屏幕。任何幫助都非常令人滿意。如何設置ImageView和兩個TextviewS具有相同的高度?
這裏的佈局:
<?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>
什麼是圖像的尺寸? – 2012-03-31 17:21:34
你想讓textviews具有相同的高度還是全部具有相同的高度? – Squazic 2012-03-31 17:22:42
@Win Myo Htet圖像是753像素高* 401像素寬度 – 2012-03-31 17:23:25