Question

I have an ImageView in my app and the fading Effect of the image view not work here is my imageView

<ImageView
    android:id="@+id/prevImageview"
    android:layout_width="200dp"
    android:layout_height="100dp"
    android:layout_weight="0.61"
    android:fadingEdge="horizontal|vertical"
    android:requiresFadingEdge="horizontal|vertical"
    android:fadingEdgeLength="20dp"
    android:src="@drawable/landscape_" />

but i can't see any fading effect. can anyone tell me what is the solution? Thanks

No correct solution

OTHER TIPS

Okay try to use below code.

Create XML called fadein.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:fillAfter="true" >

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

</set>

and then add this to your image-view

<ImageView
    android:id="@+id/prevImageview"
    android:layout_width="200dp"
    android:layout_height="100dp"
    style="@drawable/fadein"
    android:src="@drawable/landscape_" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top