0

私は 2 つの状態 (選択されている、選択されていない) を持つ ImageButton を持っており、セレクターを使用してドローアブルを変更します。

AlphaAnimation を使用する必要があるグローのようなエフェクトを作成するために調査しましたが、alpha=0 から開始すると、背景が見えるようになり、それは望ましくありません。

2 つの画像を重ねて、一番上の画像だけをアルファアニメーション化するようなものが必要です。

どうすればいいですか?

ありがとう !

4

1 に答える 1

0
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical|center_horizontal"
android:background="#FFFFFF" >

<ImageView
    android:id="@+id/background_image"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF" />


<Button
    android:id="@+id/button_alpha"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true" />

于 2012-11-07T15:49:24.207 に答える