圆/ Android中布局菊花(风车)? [英] Circle/daisy layout (pinwheel) in Android?

查看:319
本文介绍了圆/ Android中布局菊花(风车)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建一个圆的布局。我所有的意见,应在圆。我不得不preFER怎么哪种布局?布局的重点应该是顺时针循环。

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.

编辑:

我可以做到这一点的看法,他是我的问题的更新,在评论这个问题提示。是否有任何示例做呢?

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?

该截图附后。

推荐答案

有关的人谁是未来这个问题现在我最近不得不实现这个圈子的布局和大量的搜索后,我决定了一个相对的布局,绘制花瓣形按钮不会给我,我需要这样的效果我也跟着这些步骤

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

您可以看到,如果你测试的应用程序NBC在iPhone上它们放置在文字不可见按钮和圆的只是覆盖按钮图像,但我不喜欢这个解决方案。

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 .

因此​​,这里是我是如何实现它
1 - 要求与从UI的家伙就可以了字花,并告诉他,颜色必须牢固无梯度什么那么然后问他送我每种颜色的十六进制值。
2 - 然后,我实现了检查用户点击ACTION_UP事件像素的颜色,并推出与颜色的类别相应的事件监听运动
3,我通过获取X'放大器检查的颜色;从听者,然后得到从位图图像的颜色是

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

如果有人需要它,我会后的code的片段,但我现在没有在我身上。

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

这篇关于圆/ Android中布局菊花(风车)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆