私は、水平方向と2つのImageViewでLinearLayoutを持っています。そして、幅が画面の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のは 'アンドロイドを持っている必要がありlayout_weight = "1"' –
をandroid:layout_weight = ""を使用してください。 – user1744952
Thx @SherifelKhatib私の問題を解決する= DD。 –