Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在向我的超级视图添加一个子视图,我需要知道如何告诉超级视图忽略触摸事件,以便接收触摸事件的唯一视图是子视图。这将如何完成?
谢谢!
将userInteractionEnabledsuperview 的属性设置为NO:
userInteractionEnabled
NO
view.superview.userInteractionEnabled = NO;