這裏是我的代碼:Android的佈局父權Visiblitiy顯示錯誤
<ProgressBar
android:id="@+id/progressBar_main"
style="?android:attr/progressBarStyleLarge"
android:layout_width="30dip"
android:layout_height="30dip"
android:layout_marginRight="8dip"
android:layout_marginTop="8dip"
android:layout_alignParentRight="true"
android:visibility="gone"/>
<ImageView
android:id="@+id/iv_broadcast"
android:layout_width="45dip"
android:layout_height="45dip"
android:layout_marginRight="3dip"
android:layout_marginTop="1dip"
android:layout_toLeftOf="@+id/progressBar_main"
android:scaleType="fitXY"/>
正確的圖像圖像1和圖像2,實際輸出圖像1和圖像3。
當應用程序正在加載數據時,加載欄將設置爲VISIBLE
,並且圖像正確顯示爲image1。當加載過程結束時,加載欄將設置爲GONE
,它應顯示image2,但它顯示爲image3,這是錯誤的。
如何設置糾正一個(image1 + image2),而不是(image1 + image3)。我不知道爲什麼笑臉會左轉。由於
由於Android的:layout_toLeftOf =「@ + ID/progressBar_main」走了這麼.. – Nikhil