Layout animation effect
Add a simple animation effect to a layout
Public classMainactivityextendsappcompatactivity {@Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (Activity_main); //set an animation effectScaleanimation SA =NewScaleanimation (0,1,0,1, animation.relative_to_self,0.5f,animation.relative_to_self,0.5f); Sa.setduration (1000); //set up a layout animation controller, configure animation, and delay (latency)//A delay is a sub-item in a layout that is loaded after the last complete f%, which is equivalent to sequentiallyLayoutanimationcontroller Lac =NewLayoutanimationcontroller (SA, 0.2f); //Locate the layout by ID and set the Layout animation controller((linearlayout) Findviewbyid (r.id.layout)). Setlayoutanimation (LAC); }}
[2017-8-02] Android Learning Day9