Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在图像边框周围添加动画灯光?_Android - Fatal编程技术网

Android 如何在图像边框周围添加动画灯光?

Android 如何在图像边框周围添加动画灯光?,android,Android,这是我的动画图像代码,工作正常,但我想在图像周围添加绿色照明边框,我怎么做?喜欢这个图像吗 对于图像圆形边框上的淡入淡出 public class MainActivity extends Activity { Button btnAnimation, btnAnimation1, btnAnimation2; Animation performAnimation, performAnimation1, performAnimation2; ImageView androidImageVi

这是我的动画图像代码,工作正常,但我想在图像周围添加绿色照明边框,我怎么做?喜欢这个图像吗

对于图像圆形边框上的淡入淡出

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>
公共类MainActivity扩展活动{
按钮btnAnimation、btnAnimation1、btnAnimation2;
动画表演,表演1,表演2;
图像视图和图像视图;
@凌驾
创建时的公共void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
performAnimation1=AnimationUtils.loadAnimation(this,R.layout.animation1);
性能1.设置重复计数(4);
androidImageView=(ImageView)findViewById(R.id.androidImageView);
btnAnimation1=(按钮)findViewById(R.id.btn_animation1);
btnAnimation1.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图v){
androidImageView.startAnimation(性能1);
}
});
}
}

不能创建具有灯光效果的第二个图像。然后淡入淡出,就像你做你的图像一样?不,我想添加图像的照明边框,它照亮图像边框上的照明从图像上发出的绿色光线?这就是我所指的。你刚才键入的句子太让人困惑了:如果我在图像背景上添加绿色照明,然后淡入淡出,我该怎么做?你需要做的是创建一个单独的图像,覆盖原始图像。可以分别淡入/淡出。