1. How do I draw graphics on the windows of an android application?
- Inherit view
- Implementing the OnDraw () method in view
2. How do I draw a circle, hollow ellipse?
- Canvas.drawarc or Canvas.drawcircle method to draw a circle
- Canvas.drawarc (Rectangle object, 0,360,true,paint);
3. Two ways to draw bitmaps?
- Law 1:canvas.drawbitmap (bitmap,10,10,null); Draw on the canvas
- Law 2:drawable.draw (canvas); Paste the picture onto the canvas
4. How do I set the transparency of an image?
5. How do I rotate a graphic?
- Matrix matrix=new Matrix ();
- Matrix.setrotate (120, coordinates 1, coordinates 2); Rotate 120 degrees by coordinates
- Canvas.setmatrix (matrix);
6. How do I animate with view?
- Keep your phone screen refreshed by calling the View.invalidate method
7. What kinds of paths are supported by the drawing API of the Android SDK?
- Cornerpatheffect class: Converts the angle between the segment and the segment into rounded corners.
- Dashpatheffect class: This class is used to draw dashed paths.
- Pathdashpatheffect class: This class can be composed of a dashed path alone.
- Composepatheffect class: This class can combine two effects together.
8. How to implement a circular display of text rendering?
- Use Canvas.drawtextonpath ("text", path,-55,0,paint);
9. How do I control the looping of frame animations?
- Static configuration: Set the Android:oneshot property in the frame animation file
- Dynamic configuration: Using the Animationdrawable.setoneshot method
What kinds of tweened animations are supported by the 10.Android SDK?
- Move motion Tween animations
- Rotate motion Tween animations
- Scale motion Tween animations
- Transparency Tween Animations
11. How do I customize the animation renderer?
- Custom class Implementation Interpolator interface
- Use animation to call the renderer together
- Note: Custom renderers cannot be specified by the Android:interpolator property in the XML file.
Android Interview Collection 2D graphics and animation technology