【问题标题】:android alpha animation remove alphaandroid alpha动画删除alpha
【发布时间】:2015-11-18 22:53:50
【问题描述】:

我的 Xml 文件中有 Imageview,我的 imageview 中有 0.6f alpha。这是一个代码

 <ImageView
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:scaleType="centerCrop"
  android:alpha=".60"
  android:id="@+id/u_go_dashboard_bill"/>

现在我想删除带有淡入淡出动画的 alpha。我的意思是 alpha 100%。我还写了一些 java 代码,但我无法更改它

  AlphaAnimation alpha = new AlphaAnimation(0.0F, 1.0F);
            alpha.setDuration(150);
            alpha.setFillAfter(true);
            dashboardBillAvatar.startAnimation(alpha);

我该如何解决我的问题?如果有人知道解决方案,请帮助我 p.s 我从来没有做过 alpha 动画,我不知道如何使用它 谢谢大家

【问题讨论】:

    标签: android android-animation fadein fadeout alpha


    【解决方案1】:

    试试这个:

    ImageView yourImageView = (ImageView) findViewById(R.id.u_go_dashboard_bill);
    yourImageView.animate().alpha(1.0).setDuration(150).start();
    

    【讨论】:

      猜你喜欢
      • 2014-01-04
      • 1970-01-01
      • 2012-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多