2

I have buttons laid out diagonally with their image frames as shown in the picture below. How can I alter the corner points so the buttons don't significantly overlap?

alt text

I know I could just create a rectangular UIButton and rotate it, but I may eventually need custom-shaped buttons anyway. Also, my button images are essentially text with a transparent background, like shown.

4

2 回答 2

2

除了矩形之外,没有内置的方法可以做任何事情。在这种情况下,旋转它会起作用,但如果你真的想发挥创意,你可以编写自己的课程。您可以使用多边形或其他形状,然后测试触摸以查看它是否位于形状内。然后你必须处理所有的图像切换和目标/动作的东西。

于 2009-06-28T00:45:51.130 回答
0

您可以将单个 UIImageView 与看起来像您想要的图像一起使用。然后只需使用 touchesBegan 并通过触摸发生的确切点。

于 2009-06-28T00:49:40.373 回答