在一个superview中,添加了一个subview.tap一下superview,将subview隐藏起来. 在视图superview添加一个UITapGestureRecognizer对象,在UITapGestureRecognizer对象的action中实现隐藏subview的逻辑代码. UIView *superview = [[UIView alloc] initWithFrame:CGRectMake:(0, 0, 320, 480); UIView *subview = [[UI…