0

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

Amir
  • 652
  • 9
  • 19

1 Answers1

0

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_" />
InnocentKiller
  • 5,234
  • 7
  • 36
  • 84
  • Thanks, but i can't see any fading effect yet – Amir Feb 11 '14 at 08:48
  • I think it's because of less time you are not able to see effect, increase the time in duration like `android:duration="1000"` with `android:duration="5000"`. and try – InnocentKiller Feb 11 '14 at 08:53
  • I have a question: what mean the duration? i just want static fading effect on image border like this: http://www.filterforge.com/filters/11330.jpg – Amir Feb 11 '14 at 09:02
  • I try that with android:duration="10000" but this does not work – Amir Feb 11 '14 at 09:32