animation - How to animate whole LinearLayout and its inside views Android? -


i have linearlayout, contains imagebuttons. want fadeout linearlayout , children. tried use alphaanimation. if start animation imagebutton inside linearlayout, works fine. when start animation linearlayout instead of imagebuttons, nothing happens. can me?

you can try following animation xml

<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"  android:interpolator="@android:anim/linear_interpolator">   <alpha       android:fromalpha="0.0"       android:toalpha="1.0"       android:duration="5000"/> </set> 

and can try following code snippet

linearlayout layout = (linearlayout)findviewbyid(r.id.mainlayout); animation anim = animationutils.loadanimation(this, r.anim.fade_in); layout.startanimation(anim); 

its worked fine me.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -