views:

30

answers:

1

I have an UIView that in front of a bigger UIView, I want to hide that current View when tap on the behind View but I can't get Touch Up Outside event work, Touch Up Inside that View work fine.

(The behind View have another controls)

Thanks

Tung Do

+3  A: 

The Touch Up Outside is triggered when the view is touched, but then the finger moved outside the view and is lifted. You cannot get touch events for other views with that.

To accomplish what you want, you need a transparent view (opaque = NO, backgroundColor = [UIColor clearColor]) that fills the whole screen behind your view of interest. And for that you can catch the Touch Up Inside event and then hide both views.

DarkDust
Thanks for your help, I will try your suggestion.
Tùng Đỗ