【问题标题】:Custom UIButton focus not working properly in tvOS自定义 UIButton 焦点在 tvOS 中无法正常工作
【发布时间】:2016-09-12 21:22:32
【问题描述】:

我有一个这样的UIViewController

  +View
       button1
       button2
       backgroundImage
       ScrollView
              scrollBackgroundImage
              scrollButton1
              scrollButton2

所有按钮都是自定义类型 如果初始焦点在button1 上,那么无论我做什么,都不会关注scrollView 内部的按钮。 如果初始焦点在button2,那么焦点永远不会转到button1/button2

如果我将所有按钮更改为键入 System,则焦点开始按预期工作。

【问题讨论】:

    标签: objective-c uiscrollview uibutton tvos


    【解决方案1】:

    实际上,焦点确实在button1button2 之间。

    如果您将按钮类型更改为Custom,则意味着您应该自己处理视觉焦点更新(例如,在didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) 方法中)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多