【发布时间】:2016-04-07 18:14:15
【问题描述】:
我正在为 tvOS 编写一个应用程序 - 在我将 UIButton 放在屏幕上之前,它都可以正常工作。添加按钮时的问题是 touchesBegan 和 touchesMoved 停止工作。如果我移除按钮,则 touchesBegan 和 touchesMoved 将再次开始正常工作。为了实验,我已经尝试取消选中“启用用户交互” - 但这没有任何区别。我也尝试过继承 UIButton 并添加以下代码:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesBegan:touches withEvent:event];
[self.nextResponder touchesBegan:touches withEvent:event];
}
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[super touchesMoved:touches withEvent:event];
[self.nextResponder touchesMoved:touches withEvent:event];
}
遗憾的是,这似乎也不起作用。有没有人对我下一步可能尝试什么有任何建议?
【问题讨论】:
-
除了按钮之外,您在该视图上还有什么?你想达到什么目标?
标签: uibutton tvos touchesbegan touchesmoved