0

这是我的动画图像代码工作正常,但我想在图像周围添加绿色照明边框我怎么做?喜欢这张图片 http://imgur.com/qg0JM0q 吗?

在图像圆形边框上淡入淡出???

public class MainActivity extends Activity {

Button btnAnimation, btnAnimation1, btnAnimation2;
 Animation performAnimation, performAnimation1, performAnimation2;
 ImageView androidImageView;

 @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);


performAnimation1 = AnimationUtils.loadAnimation(this, R.layout.animation1);
 performAnimation1.setRepeatCount(4);



androidImageView = (ImageView)findViewById(R.id.androidImageView);

btnAnimation1 = (Button)findViewById(R.id.btn_animation1);




btnAnimation1.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
androidImageView.startAnimation(performAnimation1);

 }
 });



}

 }




                <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ImageView
android:id="@+id/androidImageView"
android:layout_width="30dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="192dp"
android:adjustViewBounds="false"
android:src="@drawable/alertlogo" />



<Button
android:id="@+id/btn_animation1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/androidImageView"
android:layout_below="@+id/btn_animation"
android:text="perform animation 2" />



</RelativeLayout>






<!------------ animation1.xml---->



          <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator">

<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="8000" />

</set>
4

0 回答 0