簡體   English   中英

通過在android中放置一個中心以圓形方式放置圖像視圖

[英]Placing imageviews in a circular manner by placing a center in android

我想在android 4.1實現拖放 ,因為我想圍繞中心點以圓形方式放置我的圖標圖像視圖。 (使用圖像視圖,我可以完美地實現拖放,位圖有點復雜)

我嘗試使用位圖和繪畫,但它不像我們在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 ?

看看這個鏈接的拖放。

在此先感謝您的幫助。

我在android中使用Math實現了。

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

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

希望它對你有所幫助。 請按照此處了解更多信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM