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.
我有一个从 NIB 加载的 UIImageView。我已经连接了一个手势识别器来处理点击,但是当我运行应用程序时,没有检测到点击。
您需要将 userInteractionEnabled 属性设置为 YES。默认为否。您可以通过在“属性检查器”窗格中选中“启用用户交互”在 NIB 中设置它,或者在加载 NIB 后通过设置 UIImageView 上的 userInteractionEnabled 属性以编程方式设置它。