2012-08-30 30 views
3

我想實施拖放到android 4.1中,因爲我想以圓形方式將我的圖標圖像視圖放置在中心點周圍。 (有圖像視圖,我可以實現完美的拖放和位圖,它有點複雜)通過在Android中放置中心以循環方式放置圖像查看

我嘗試使用位圖和繪畫,但它不像我們可以在android 4.1中得到的那樣平滑。

Is there any method or way in android 4.1 by which i can place the imageviews in circular manner by giving the radius of the circle and number of sections it will get divide, its like a math question ?

看看這個link拖放。

在此先感謝您的幫助。

回答

2

我已經實現在Android中使用數學

我分享我的代碼的一部分:

double xOffset = currentRadius * Math.cos(Math.toRadians(d)); 
double yOffset = currentRadius * Math.sin(Math.toRadians(d)); 

希望這將有助於到u。請按照here瞭解更多信息。