animation - How to bring animated effects in background in Android app? -
I'm trying to add animation when loading with my app (not sure it would be a proper word) The first screen. I am developing a holiday app and have already set up an image (a static image of sand) in the form of a background. I hope sand image background and the impact of the waves that hit the coast. How to go about achieving this? I want wave in this picture in motion ->
Place each frame in a different image After the drawing folder, use an XML to define the frames (e.g., animated.exml)
Android: ADI = "@ + id / selected" Android: oneshot = "false "& Gt; & Lt; Item android: drawable = "@ drawable / 0" Android: period = "50" /> & Lt; Item android: drawable = "@ drawable / 1" Android: period = "50" /> & Lt; Item android: drawable = "@ drawable / 2" Android: duration = "50" /> & Lt; Item android: drawable = "@ drawable / 3" android: duration = "50" /> & Lt; Item android: drawable = "@ drawable / 4" android: duration = "50" /> & Lt; Items Android: Dragon = "@ Draubel / 5" Android: Period = "50" /> & Lt; / Animation-list & gt;
To make this animate, use it:
// will host the animation and the image load that our animation drainable XML sets to its background Do Resources Image View IMG = (Image View) VVBIID (RIDMCC_IJG); Img.setBackgroundResource (R.drawable.ANIMATED.xml); // Get the background, which is compiled for an animation draconable object. Animation Drawable Frame Animation = (Animation Drainage) img.getBackground (); // Start the animation (looped playback by default) frameAnimation.start ();
Comments
Post a Comment