tvos

How to use MarqueeLabel in Swift?

蓝咒 提交于 2020-01-11 03:23:07
问题 I want to know if there's a way to enable horizontal scrolling of text i.e., marquee type text. I have used this library: https://github.com/cbpowell/MarqueeLabel-Swift and added the "MarqueeLabel.Swift" file to my application. But so far, it doesn't show the marquee effect that I wanted. This is how I implemented it: class ViewController: UIViewController { @IBOutlet weak var marqueeLabel: MarqueeLabel! override func viewDidLoad() { super.viewDidLoad() self.marqueeLabel.tag = 101 self

Changing the color of a Button in SwiftUI on tvOS

≡放荡痞女 提交于 2020-01-06 08:24:05
问题 I am trying to change the color of a SwiftUI Button on tvOS. Modifying the background almost works, except that you can see that the underlying UIButton is actually using a rounded, translucent image over the top of the background. This results in a different colour at the corners where the rectangular background lies outside the rounded image. Adding .padding emphasises this issue: struct ContentView: View { @State var selected = false var body: some View { Button(action: { self.selected

Changing the color of a Button in SwiftUI on tvOS

落爺英雄遲暮 提交于 2020-01-06 08:23:45
问题 I am trying to change the color of a SwiftUI Button on tvOS. Modifying the background almost works, except that you can see that the underlying UIButton is actually using a rounded, translucent image over the top of the background. This results in a different colour at the corners where the rectangular background lies outside the rounded image. Adding .padding emphasises this issue: struct ContentView: View { @State var selected = false var body: some View { Button(action: { self.selected

How to change UICollectionView zIndex?

霸气de小男生 提交于 2020-01-06 04:21:07
问题 Check the image below. I need to highlight the focused cell such that it is above all the cells in collectionView . I know I have to change the zIndex of the focused cell. How to do that? I need the logic. My code is in objective-c . This is for tvOS but iOS code will also work here I guess. 回答1: Have you tried setting value for cell.layer.zPosition ? 回答2: Try manually applying layer.zPosition to be the zIndex in applyLayoutAttributes: method of UICollectionViewCell subclass: - (void

static arm64 iOS library does not link in a tvOS project

扶醉桌前 提交于 2020-01-06 03:26:15
问题 I have a static fat library, which contains the architecture arm64, that can be linked in a project for iOS. However, when I try to use this library in a tvOS project I have the following link error: "... building for tvOS, but linking in object file built for iOS, for architecture arm64" I am not sure if I can reuse arm64 libraries, which work properly in iOS projects, in a tvOS project or perhaps I will have to create an arm64 library from a tvOS project (TV static library). 回答1: For Xcode

static arm64 iOS library does not link in a tvOS project

陌路散爱 提交于 2020-01-06 03:25:26
问题 I have a static fat library, which contains the architecture arm64, that can be linked in a project for iOS. However, when I try to use this library in a tvOS project I have the following link error: "... building for tvOS, but linking in object file built for iOS, for architecture arm64" I am not sure if I can reuse arm64 libraries, which work properly in iOS projects, in a tvOS project or perhaps I will have to create an arm64 library from a tvOS project (TV static library). 回答1: For Xcode

How to change focus programmatically in tvOS

谁说胖子不能爱 提交于 2020-01-05 09:09:34
问题 I am developing a tvOS app in swift. I am using UITabBarController in the app. My requirement is to hide the tabbar automatic after 10 seconds and focus can move to AVPlayerViewController inside the tabbar item. I tried to override preferredFocusedView , but focus cannot move to AVPlayerViewController . func updateFocus() { self.playerController.view.hidden = false self.playerController.view.alpha = 1.0 self.playerController.view.userInteractionEnabled = true self.playerController.view.layer

How to change focus programmatically in tvOS

不打扰是莪最后的温柔 提交于 2020-01-05 09:08:54
问题 I am developing a tvOS app in swift. I am using UITabBarController in the app. My requirement is to hide the tabbar automatic after 10 seconds and focus can move to AVPlayerViewController inside the tabbar item. I tried to override preferredFocusedView , but focus cannot move to AVPlayerViewController . func updateFocus() { self.playerController.view.hidden = false self.playerController.view.alpha = 1.0 self.playerController.view.userInteractionEnabled = true self.playerController.view.layer

React-native: tvOS How to force a Button to be focused?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-05 04:28:06
问题 It is possible to force a button to be focused ? I know the user can focused an element but I want to make it programmatically 回答1: Yes it is possible, with tvOS and react native if you want to force a focusable component to be focus you just need to set hasTVPreferredFocus to true For example: <TouchableHighlight hasTVPreferredFocus={true} onPress={() => {}} > <Text>Hello</Text> </TouchableHighlight> 来源: https://stackoverflow.com/questions/43862802/react-native-tvos-how-to-force-a-button-to

AVPlayerViewController (tvOS) doesn't pause on viewWillDisappear

只谈情不闲聊 提交于 2020-01-04 05:38:05
问题 I have several AVPlayerViewControllers set as the ViewControllers of a UITabBarController . What I want is having the video of the currently visible AVPlayerViewController automatically pause playing when the user switches to another tab (which is another AVPlayerViewController ) I tried this approach: override func viewWillDisappear(animated: Bool) { player?.pause() super.viewWillDisappear(animated) } but the video just keeps running in the background. (audio is still running at least)