开发者

How does iPhone draw controller?

I'm a newbie in iPhone development and now encounter a problem:

I want to add a small hotspot on a large image and simply came up with the idea that I can add a button in that area setting alpha 0 to hide the button. Unfortunately, the phone does not response click events any more. Instead, if I increase the alpha, I can receive click events without any problems. So I wonder in which order does iPhone draw controller on the screen. Is it because my bac开发者_如何转开发kground image is drawn after the button if I set alpha of button too low, so the click event is intercepted by the background image?

Any hints will be highly appreciated. Thank you all in advance!

Best Regards.


Set the button's style to Custom; the button will not be drawn, but should remain fully active.


The problem is not the order in which the views are drawn, it's rather that if a view's alpha is 0 it does not receive touch events. it's like the view is not there at all.

but you don't have to set the alpha to 0 on the UIButton, you can simply make it a Custom button instead of a Rounded Rect button. it'll be invisible and still work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜