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

Thursday, September 29, 2022

[FIXED] How to make a SwiftUI list scrollable in tvOS

 September 29, 2022     listview, scroll, scrollview, swiftui, tvos     No comments   

Issue

I have a List with content and when I build to an Apple Tv I cannot scroll to the bottom of the List.

I tried the focusable on the List rows but I cannot seem to get the list to scroll. I also replaced the List with a ScrollView to no avail.

List(self.someData) { data in
     SomeListRow(data: data)
}
.shadow(radius: 5)
.focusable(true)

List(self.someData) { data in
     SomeListRow(data: data)
      .focusable(true)

}
.shadow(radius: 5)

Solution

SwiftUI on tvOS has a bug where if you set a shadow on something none of the components in it receive user input events such as focus. There's an easy workaround though, just set your shadow on the background layer.

.background(
    Color.white
        .shadow(radius: 5)
)


Answered By - Jeff
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

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