मैं एनीमेशनएंड्रॉयड एनीमेशन अल्फा
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<alpha
android:fromAlpha="0.2"
android:toAlpha="1.0"
android:duration="500"/>
</set>
मिल गया है और imageView
<ImageView
android:id="@+id/listViewIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/settings"
android:alpha="0.2"/>
और कोड:
final Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
final ImageView iv = (ImageView) findViewById(R.id.listViewIcon);
anim .setFillAfter(true);
iv.startAnimation(anim);
शुरुआत में
तो मैं अल्फा 0.2 के साथ और कम से imageView है अंत में मैं अल्फा 1 के साथ ImageView रखना चाहता हूं। लेकिन यह इस तरह काम नहीं करता है - जब एनीमेशन अधिक अल्फा शुरू होता है और एनीमेशन फिनिस एच अल्फा 0.2
मेरी छवि को 0.2-> 1 से एनिमेट करने के लिए क्या बदलना है?
मैंने अलग-अलग सेटिंग्स के साथ जांच की है - मैंने एंड्रॉइड सेट किया है: अल्फा = "1.0", एल्पा = "1.0" से एल्फा = "0.2" यह काम करता है जैसे कि मुझे उम्मीद है - अल्फा 1 से 0.2 तक। यह imageView से अल्फा एनीमेशन से अल्फा से गुणा किया जाता तरह लग रहा है ...
अंत में 0.2 अल्फा को कूदने से रोकने के लिए, 'fillAfter' विशेषता का उपयोग करें: http://developer.android.com/reference/android/view/animation/Animation.html#attr_android:fillAfter – Jave
यह मामला नहीं है। अल्फा 1 पर नहीं जाता है। जब मैं 1-> 0.2 से एनिमेट करता हूं तो यह ठीक काम करता है और 0.2 पर रहता है (मैं बाद में भरता हूं)। जब मैं 0.2 से 1 तक एनिमेट करना चाहता हूं तो यह लगभग 0 तक फीका होता है और 0.2 – wioskamala
पर जाता है क्या आपने सत्य को 'fillEnabled' सेट किया है? – Jave