开发者

iphone, able to hide a view and touch it?

apparently,

self.hidden = YES;
self.userInteractionEnabled = YES; 

hides the view but doesn't recognize touch events.

I开发者_StackOverflow中文版s there a way of hiding a view and touching it?


There is NO way to do this. The solution is to make another UIView, which is empty. The only purpose of this new UIView is to catch the click.

That is the only way to do it.

(You could also perhaps make a large transparent button, depending on your needs.)

The alpha thing is a famous gotchya. If you alpha away a UIView, it becomes unclickable. You will only be able to click it, if you can see it. Hope it helps.


set the backgroundColor to clear works for me. You may also need to set the text color.

view.backgroundColor = UIColor.clear
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜