私はtvosアプリケーションを構築していますが、私はUITextViewをtvos Moviesアプリケーションのように動作させたいと考えています。私は特に注目を集めています。この2枚の写真を見てください。 tvos:ムービーのようなUITextViewフォーカスの外観App
現在、それがフォーカスされたときに、私はただのTextViewに背景色を追加することですが、私は、添付画像では、この集中外観を達成することができますか。誰かがより多くのテキストがあるとき、私はTextViewの中で、このMORE機能を実現する方法を提案することができればここに私の小さなコード
override func didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) {
super.didUpdateFocusInContext(context, withAnimationCoordinator: coordinator)
if context.previouslyFocusedView == lessonDescriptionTxt {
coordinator.addCoordinatedAnimations({() -> Void in
self.lessonDescriptionTxt.layer.backgroundColor = UIColor.clearColor().CGColor
}, completion: nil)
}
if context.nextFocusedView == lessonDescriptionTxt {
coordinator.addCoordinatedAnimations({() -> Void in
self.lessonDescriptionTxt.layer.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.2).CGColor
}, completion: nil)
}
}
もあります。私もこの質問Make UILabel focusable and tappable (tvOS)を読むが、それは私の仕事をしません。
弾力のある外観は選択するとどうなりますか? – Madu
この要点https://gist.github.com/Cedrick84/8922a0af730c39c05794は、「バウンシー」モーションエフェクトを実装しています。 –