Hello, found a issue with tvOS 17. When I use either a frame or padding, the button highlight has no round corners anymore, seems like the left and right margin of buttons is not displayed. Works perfectly fine on tvOS 16.
Is this a bug? Any way to fix this?
struct ListOfButtons: View {
var values = (0...13).map{"item \($0)"}
@State var selectedValue: String = "item 0"
var body: some View {
List(values, id: \.self) { item in
Button {
selectedValue = item
} label: {
Text(item)
}
}
.frame(width: 200, height: 900)
.padding(40)
.background(Color.cyan)
}
}
tvOS 16.4:
tvOS 17:
I find a way to modify this. scrollClipDisabled(_:) was added in tvOS 17. Set this to true to tell your scroll views to not clip content.
struct ListOfButtons: View {
var values = (0...13).map{"item \($0)"}
@State var selectedValue: String = "item 0"
var body: some View {
List(values, id: \.self) { item in
Button {
selectedValue = item
} label: {
Text(item)
}
}
.scrollClipDisabled(true)
.frame(width: 200, height: 900)
.padding(40)
.background(Color.cyan)
}
}
https://developer.apple.com/documentation/swiftui/view/scrollclipdisabled(_:)