Circle/daisy layout (pinwheel) in Android?

2019-06-09 08:15发布

I want to create a circle layout. All of my views should be in the circle. Which layout do I have to prefer and how? The focus of the layout should be a clockwise circle.

Edit:

I can do this view and it is an update of my question, prompted by the comments to this question. Is there any example for doing that?

The screenshot is attached below.

image http://www.freeimagehosting.net/uploads/e11f35e522.png

1条回答
Evening l夕情丶
2楼-- · 2019-06-09 08:49

For people who is coming to this question now I recently had to implement this circle layout and after a lot of searching I decide that a relative layout that draws a petal shaped buttons will not give me the effect I needed so I followed those steps

you can see if you tested the nbc app on iphone they are placing invisible buttons on the words and the circle is just an image with the button overlaid but I didn't like this solution .

So here's how I implemented it

1- asked for the flower with the words on it from the UI guy and told him that the colors must be solid no gradient what so ever and then asked him to send me the hexadecimal values of each color.

2- then I implemented a motion listener that checks the color of the pixel the user clicked on ACTION_UP event and launch the event corresponding with the category of that color .

3-I check the color by getting x & y from the listener and then get the color from the image bitmap

I'll post snippets of the code If anyone needs it but I don't have it on me now.

查看更多
登录 后发表回答