Androidでは、2つの画像を1つ小さくアニメーション化しています大きい方の上に。スモールはPhotoshopを使用して生成され、可視部分はチェッカーボードパターン(透明であると想定される)で囲まれています。アニメーションが実行されると、画像は表示されますが、チェッカーボードのパターンは灰色の正方形として表示されます。
どうすれば透明にできますか。
これが、imagebuttonがlayout.xmlでセットアップされる方法です。
<ImageButton
android:layout_gravity="top|left"
android:layout_marginLeft="184dp"
android:layout_marginTop="55dp"
android:id="@+id/videothumb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/button_power_on" />
そしてアニメーションファイル:
<?xml version="1.0" encoding="utf-8"?>
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="0.0"
android:toAlpha="0.8"
android:duration="5000"
android:repeatMode="reverse"
android:repeatCount="infinite"
/>
回答:
回答№1は1ImageButtonを使用しており、表示されている灰色がボタンのデフォルトの背景であるためだと思います。代わりにImageViewを使用してください。