apple-tv

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

Programmatically sleep Apple TV on tvos

故事扮演 提交于 2020-01-04 05:37:14
问题 I'd like to have a sleep timer within my own tvos app. Is there a way to enable/disable sleeping on tvos? I know you disable sleeping using: [UIApplication sharedApplication].idleTimerDisabled = YES; But is there a way to then enable sleep right away when a timer finishes? 来源: https://stackoverflow.com/questions/33639783/programmatically-sleep-apple-tv-on-tvos

How do you set canBecomeFocused for a custom view

故事扮演 提交于 2020-01-02 09:12:26
问题 I am making an application for tvOS. I have a view that contains a UIButton and a custom UIView that contains a couple other custom views. The simulator is only able to highlight the UIButton and not the custom view. According to the Building Apple TV Apps Docs: If your custom view needs to be focusable, override canBecomeFocused to return YES (by default, it returns NO). According to the canBecomeFocused Docs: canBecomeFocused will return YES if the view can become focused; NO otherwise.

Customize Keyboard in tvOS

放肆的年华 提交于 2020-01-02 02:54:07
问题 I use UISearchController to search inline with keyboard, textfield and results in one screen. Does tvOS allow to customize keyboard? I want to use dark design, but I don't know how to customize the keyboard. For example YouTube app did that. They have black screen with white keyboard 回答1: A UISearchController has a UISearchBar , which conforms to UITextInputTraits . This means it has a keyboardAppearance which you can set to UIKeyboardAppearanceDark to get a dark keyboard appearance. This isn

Disable AirPlay with MPMoviePlayerController

此生再无相见时 提交于 2019-12-30 08:13:34
问题 I have an instance of a MPMoviePlayerController which is being used to display some live streaming video on an iPhone app. This is working fine, however I wish to remove all AirPlay functionality. To be sure, I specifically disable AirPlay like so: if([self.moviePlayerController respondsToSelector:@selector(setAllowsAirPlay:)]) { self.moviePlayerController.allowsAirPlay = NO; } However, even with this code, I still see the AirPlay icon on the video controls. If I select this, and select my

Can I mix UIKit and TVMLKit within one app?

≡放荡痞女 提交于 2019-12-28 03:38:05
问题 I'm exploring tvOS and I found that Apple offers nice set of templates written using TVML . I'd like to know if a tvOS app that utilises TVML templates can also use UIKit . Can I mix UIKit and TVMLKit within one app? I found a thread on Apple Developer Forum but it does not fully answer this question and I am going through documentation to find an answer. 回答1: Yes, you can. Displaying TVML templates requires you to use an object that controls the JavaScript Context: TVApplicationController .

Force view to reload tvml content on Apple TV/tvos

霸气de小男生 提交于 2019-12-23 15:49:34
问题 I have been working on dynamically generating tvml-templates with very frequently changing content for a tvOS app on Apple TV. Generating the templates works fine, however I have not been able to get the app to update/reload the content of a template when navigating back and forth between views or leaving and reentering the app. Only rebooting seems to reload the tvml template. 回答1: Your template will refresh itself automatically whenever you manipulate the TVML within the template document.

Apple TV App not exiting to the home screen from initial view controller when menu button pressed on remote

北城以北 提交于 2019-12-23 07:27:26
问题 I've just had an Apple TV app rejected because of 'In addition, the Menu button on the Siri Remote does not behave as expected in your app. Specifically, when the user launches the app and taps the Menu button on the Siri Remote, the app does not exit to the Apple TV Home screen.' I'm looking this up and from what I can tell this should be the automatic behaviour of pressing the menu button when on the initial view controller. However I have a navigation controller with a root view controller

How to use iOS 5+ AirPlay for a second screen

不羁岁月 提交于 2019-12-22 13:55:11
问题 I'm toying with AirPlay using an iPhone 4S and I'm having some trouble. I've updated my Apple TV 2 to the latest (4.4.3 I think? I forget, it's in the other room and I'm too lazy to check) and I have iOS 5.0 on my 4S while I use Xcode 4.2 Build 4D199. I wrote a simple UIView app that attempts to draw on a second screen when available. Here's what I have in my viewDidLoad: - (void)viewDidLoad { [super viewDidLoad]; [self.view addSubview:[[MPVolumeView alloc] initWithFrame:CGRectMake(0, 0, 320,

tvOS 10. PreferredFocusView is deprecated. How do I change to preferredFocusEnvironment?

社会主义新天地 提交于 2019-12-22 10:38:46
问题 I have a subview for which I have overridden the preferredFocusedView. The subclass has a UIView called viewToFocus. I check if that view exists, if it does I focus that view, if not I return the preferredFocusedView of the parent. Since I updated to tvOS 10 today I am getting the following error: 'preferredFocusedView' is deprecated: first deprecated in tvOS 10.0 - Use -preferredFocusEnvironments instead. I cant find anywhere in the documentation that explains how preferredFocusEnvironment