tvos

Manually setting focus to a <lockup> element in TVJS

為{幸葍}努か 提交于 2020-01-25 12:25:27
问题 I can't find any method in the Documentation to manually set the focus to an element. It is supposed to support the DOM Element class, but when i do var elem = ele.ownerDocument.getElementById("start"); elem.focus(); it does nothing. elem is correctly set, but it doesn't recognize the focus() method. 回答1: Apple's TVJS Framework doesn't provide any method in his classes to manually focus an element. Neither in the standard Document Object Module classes it incorporates have any kind of method

Apple Push Notifications in tvOS

雨燕双飞 提交于 2020-01-23 01:55:29
问题 Hi i am a newbie to tvOS. I have an TV application which is registered for APNS. But while i push a notification i am not able to get the notifications. i am getting the device token but not the notification. While i try with the Mobile Devices i am getting the notifications,But not in the tvOS why is it so...? How can i solve this..? let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in if granted == true { print(

Invalid update: invalid number of items in section 0.

旧街凉风 提交于 2020-01-20 05:22:45
问题 Recently I got the following error: Fatal Exception: NSInternalInconsistencyException Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (13) must be equal to the number of items contained in that section before the update (12), plus or minus the number of items inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).

TVML - how to modify formTemplate to show “pin entry”

别说谁变了你拦得住时间么 提交于 2020-01-17 13:57:07
问题 TVML's formTemplate can easily be adapted to only allow numeric input: <formTemplate> <textField keyboardType="numberPad">0000</textField> <footer> <button> <text>${TEXT("Submit")}</text> </button> </footer> </formTemplate> This gives a page like... I would like to reduce it even further to only display a "pin entry" screen as shown here: Is this possible with TVML, without hosting an own UIControl? I have nowhere found any mentioning of changing styles like this. Any idea how to achieve this

TVML-document in Swift tvOS project

末鹿安然 提交于 2020-01-17 01:24:07
问题 I have a project written in Swift for tvOS . Now I found a great TVML-document that I want to add in my project. Tell me please if there are any possible ways to do it? Can I use TVML-document as a base for UIViewController ? 回答1: I found a very nice framework that can help me to embed TVML-documents in tvOS application written in swift. Here is it https://github.com/toshi0383/TVMLKitchen. It has everything that I need to solve my problem and it also easy-to-use and install. I hope that it

How to display GameCenter leaderboard on tvOS?

梦想与她 提交于 2020-01-14 14:27:08
问题 I think I followed all the required steps to support leaderboards in my game (and they work just fine on iOS), however on tvOS it is not possible to configure the GKGameCenterViewController to show a specific leaderboard, the LeaderboardIdentifier property is simply missing (just like the ViewState ): var leaderboardController = new GKGameCenterViewController (); // Unavailable on tvOS /* leaderboardController.ViewState = GKGameCenterViewControllerState.Default; leaderboardController

How to change background color for tab in tvOS 13?

≡放荡痞女 提交于 2020-01-14 03:37:21
问题 TvOS 13. I have a UITabBarController with tabs. And can customize almost everything except this obvious thing: focused tab's background. It's always white. Guide tells Specify tints for selected and unselected items I tried: view.backgroundColor = .purple tabBar.tintColor = .yellow tabBar.barTintColor = .red tabBar.unselectedItemTintColor = .brown tabBar.backgroundColor = .green tabBar.backgroundImage = UIColor.blue.toImage() tabBar.shadowImage = UIColor.orange.toImage() tabBar

How to center align the cells of a UICollectionView in Swift3.0?

天大地大妈咪最大 提交于 2020-01-12 14:04:18
问题 Description: Answer for Objective-C and Swift2.0 : How to center align the cells of a UICollectionView? I usually would try to convert the Swift2.0 answer to the Swift3.0 solution, however the method: func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets { let edgeInsets = (screenWight - (CGFloat(elements.count) * 50) - (CGFloat(elements.count) * 10)) / 2 return UIEdgeInsetsMake(0,

How to get motion events with the Apple TV remote

﹥>﹥吖頭↗ 提交于 2020-01-12 05:26:21
问题 Has anybody figured out how to get motion events working with the new apple TV remote? Thanks. I've tried calling override func motionBegan(motion: UIEventSubtype, withEvent event: UIEvent?) { super.motionBegan(motion, withEvent: event) print("motion!") } override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) { super.motionEnded(motion, withEvent: event) print("motion ended!") } With and without calling super gives me nothing. 回答1: A great swift example can be found here

How to get motion events with the Apple TV remote

杀马特。学长 韩版系。学妹 提交于 2020-01-12 05:26:10
问题 Has anybody figured out how to get motion events working with the new apple TV remote? Thanks. I've tried calling override func motionBegan(motion: UIEventSubtype, withEvent event: UIEvent?) { super.motionBegan(motion, withEvent: event) print("motion!") } override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) { super.motionEnded(motion, withEvent: event) print("motion ended!") } With and without calling super gives me nothing. 回答1: A great swift example can be found here