Android image processing makes the image rotate at a constant speed
This article continues to write on the basis of my article Android image processing and turning the image into a circle. You can go and have a look. It doesn't matter to read it directly, and you can understand it
1. First, create a folder named anim under the res folder. Don't write the name wrong. 2. Create an XLM file in anim: IMG_ animation. XML, the name can be written casually. Be careful not to capitalize. The code is as follows:
The specific meaning is:
Duration: time</span>
Fromdegrees = "0": how many degrees do you start to turn < / span > t
Odedegrees = "360": how many degrees to rotate</span>
Pivotx = "50%: the distance between the rotation center and the left vertex of view is 50%,
Pivot = "50%: 50% from the top edge of view
Repeatcount = "- 1": number of repetitions, - 1 is the constant repetition
Repeatmode = "restart": repeat mode. Restart repeats from the beginning
The layout file code has not changed. It is still: just put a control
You can also write an ordinary control that can rotate
Is it very simple? The operation effect is as follows: there is a problem with the recording. In fact, it is running at a uniform speed.
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.