1
我正在嘗試將圖像旋轉到某種程度,並將背景填充爲紅色。例如,我有一個圖像,並希望將分鐘旋轉至15分鐘(45度),並顯示帶有紅色的四分之一圓圈。如何旋轉背景顏色的圖像?
我用下面的代碼旋轉我的旋轉到某個角度,但我不能填充背景顏色。請幫忙。
RotateAnimation rotateAnimation = new RotateAnimation(
(1 - 1) * 6, 10 * 6,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setDuration(5000);
rotateAnimation.setFillEnabled(true);
rotateAnimation.setFillBefore(true);
rotateAnimation.setBackgroundColor(Color.RED);
orgClockImage.startAnimation(rotateAnimation);
感謝
你使用的是listview嗎?如果是的話,這個鏈接可能會有所幫助http://stackoverflow.com/questions/15593152/rotating-images-in-listview – 2013-05-27 07:41:07
不,我不使用listview。我有一個像時鐘的imageview,我想旋轉分鐘niddle – Monali