PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, September 29, 2022

[FIXED] How can I scroll vertically in tvOS with SwiftUI?

 September 29, 2022     apple-tv, ios, swift, swiftui, tvos     No comments   

Issue

I don't know it's a SwiftUI specific problem but I can't scroll vertically in tvOS. It's just simple List that shows items.

var body: some View {
    List(items, id: \.self) { item in
         ItemView(item: item)
    }
}

There are 50+ items, but I can see about 10 of them.

I tried option + arrow keys, also tried with simulator's remote by holding option key. non of them worked. Is there anyone who encountered with it?

Thank you.


Solution

On tvOS List content should be active, like buttons, and then you can use Remote, or arrows on keyboard for simulator to scroll through

(tested with Xcode 11.4)

var body: some View {
    List(items, id: \.self) { item in
         Button(action: {}) {
           ItemView(item: item)
         }
    }
}


Answered By - Asperi
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing