开发者

Rotate an Image pivot in the Center - Android

开发者 https://www.devze.com 2023-03-13 07:18 出处:网络
I want to rotate an Image pivoting开发者_开发百科 in the center. Iwant to use this when i rotate the image I need to load dynamic Text as menu. Like a Jog. Any one pls help me for rotating an imageTo

I want to rotate an Image pivoting开发者_开发百科 in the center. I want to use this when i rotate the image I need to load dynamic Text as menu. Like a Jog. Any one pls help me for rotating an image


To rotate an image you can do this:

RotateAnimation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

ImageView image = findViewById(my image);
image.setAnimation(rotate);

rotate.start();

This will rotate the image one round from 0 to 360 degrees. You can set the duration too:

rotate.setDuration( 500 ); // milliseconds
0

精彩评论

暂无评论...
验证码 换一张
取 消