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

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

问题描述

我想创建一个圆形布局。我的所有观点都应该在圈子里。我喜欢什么布局和如何?布局的重点应为顺时针圆。



编辑:



我可以做这个视图是我的问题的更新,由这个问题的评论提示。有这样做的例子吗?



屏幕截图如下。



解决方案

来到这个问题,现在我最近不得不实现这个圆布局,经过大量的搜索,我决定一个相对的布局,绘制一个花瓣形按钮不会给我需要的效果,所以我按照这些步骤



你可以看到,如果你测试了nbc应用程序在iphone上,他们把不可见的按钮上的单词和圆圈只是一个图像与按钮重叠,但我不喜欢这个解决方案。 p>

这是我如何实现它



1-要求花与其UI上的字,告诉他,颜色必须是坚实的没有渐变,这是如此,然后要求他给我的每种颜色的十六进制值。



2-然后我实现了一个运动监听器检查用户点击ACTION_UP事件的像素的颜色,并启动与该颜色类别对应的事件。



3 - 我通过获取x& ; y,然后从图像位图中获取颜色



我会发布代码的代码如果有人需要它,但我现在没有它。


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.

解决方案

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.

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

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