GAU*_*VIG 5 focus objective-c tvos
UITableViewCell的默认焦点颜色为白色.我们如何改变UITableView单元格的焦点颜色?
这是一个快速代码。请转换为 Objective-C 并尝试一下。也许对你有帮助。
override func didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) {
if let nextFoc = context.nextFocusedView as? YourCellName{
nextFoc.backgroundColor = UIColor.redColor()
}
if let prevFocus = context.previouslyFocusedView as? YourCellName{
prevFocus.backgroundColor = UIColor.clearColor()
}
Run Code Online (Sandbox Code Playgroud)
看一下屏幕截图。
| 归档时间: |
|
| 查看次数: |
1626 次 |
| 最近记录: |