我无法弄清为什么我的图像不在我的图像视图范围内。相反,它漂浮在左边并隐藏起来。这是因为图形界面没有显示它吗?图像越界图像视图
编辑:
我编辑的原代码,以更清楚地显示我遇到的问题,并增加了一个图(我希望图像中红色框显示):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/top_container"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
>
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
>
<View
android:layout_height="fill_parent"
android:layout_width="0dp"
android:layout_weight="195"
android:background="#00FF00"/>
<ImageView
android:id="@+id/img"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#ff0000"
android:src="@drawable/img" />
<View
android:layout_height="fill_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="#0000FF"
/>
</LinearLayout>
</LinearLayout>
属性。也许我不理解什么?我需要增加体重吗?图像是否应该处于边界? – prostock 2011-12-17 00:09:01
你甚至尝试过吗?我复制了问题并通过增加ImageView的重量来解决问题。 – styler1972 2011-12-17 02:55:29