我有一个水平方向的LinearLayout和2个ImageView,我想让这个ImagesView在宽度上填充50%的屏幕,以在不同尺寸的每个手机或平板电脑上工作。如何把50%的宽度
事情是这样的:
+-------------+
|_____________|
| | |
| 50% | 50% |
| | |
|-------------|
| |
+-------------+
迄今为止最好的:
<?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:gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="@+id/logo_c"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/logo_animado" />
<ImageView
android:id="@+id/logo_t"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/logo_animado2" />
</LinearLayout>
每个ImageView的应该有'的android:layout_width = “0dp”'和'androdi:layout_weight = “1”' – 2013-02-08 12:58:10
使用android:layout_weight =“”。 – user1744952 2013-02-08 12:59:21
Thx @SherifelKhatib解决我的问题= DD。 – 2013-02-08 13:09:30