0

これが私のコードです:

<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"/>

ここに画像の説明を入力

正しい画像は image1 と image2 で、実際の出力は image1 と image3 です。
アプリケーションがデータをロードしているときに、ロード バーが に設定されVISIBLE、画像が image1 として正しく表示されます。ローディング プロセスが終了すると、ローディング バーが に設定されGONE、image2 が表示されるはずですが、間違って image3 として表示されます。
(画像1 +画像3)ではなく、(画像1 +画像2)を修正するように設定するにはどうすればよいですか。スマイリーが左に行く理由がわかりません。ありがとう

4

2 に答える 2

-1

プログレスバーとイメージビューの両方に android:layout_alignParentRight="true" を指定します。

于 2012-12-17T05:36:25.543 に答える
-1

このイメージビューコードを使用してください

<ImageView
     android:id="@+id/iv_broadcast"
     android:layout_width="45dip"
     android:layout_height="45dip"
     android:layout_alignParentRight="true"
     android:layout_marginRight="3dip"
     android:layout_marginTop="1dip"
     android:layout_toLeftOf="@+id/progressBar_main"
     android:scaleType="fitXY" />
于 2012-12-17T04:50:06.337 に答える