Question

I tried to make a second alpha file in my anim folder and when I create the .xml I get a warning "Unexpected text found in layout file: "xmlns:android=..."

alpha_listivew.xml

<?xml version="1.0" encoding="utf-8"?>
  <alpha>
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:fromAlpha="0.0"
     android:interpolator="@android:anim/accelerate_interpolator"
     android:toAlpha="1.0"
     android:duration="100"
  </alpha>

I tried to clean my project, format the file and rewrite the code but nothing seems to work.

Was it helpful?

Solution

You have wrongly closed the alpha tag <alpha> and then written the actual code which is invalid. Just first open <alpha xmlns:........> </alpha> like this.

Just write it as below:

<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
     android:fromAlpha="0.0"
     android:interpolator="@android:anim/accelerate_interpolator"
     android:toAlpha="1.0"
     android:duration="100">
  </alpha>

OTHER TIPS

do it as follows

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:fillAfter="true" >
   <alpha>
      android:fromAlpha="0.0"
      android:interpolator="@android:anim/accelerate_interpolator"
      android:toAlpha="1.0"
      android:duration="100"
   </alpha>
</set>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top