设置两张图片。
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/loadpage" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/default_image" />
注意,是android:background 。
然后是代码里控制。
im.getBackground(). setAlpha(50);此为,设置的透明度。
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/loadpage" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/default_image" />
注意,是android:background 。
然后是代码里控制。
im.getBackground(). setAlpha(50);此为,设置的透明度。