我無法弄清爲什麼我的圖像不在我的圖像視圖範圍內。相反,它漂浮在左邊並隱藏起來。這是因爲圖形界面沒有顯示它嗎?圖像越界圖像視圖
編輯:
我編輯的原代碼,以更清楚地顯示我遇到的問題,並增加了一個圖(我希望圖像中紅色框顯示):
<?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