Fix buttons on tvOS

This commit is contained in:
Arkadiusz Fal 2023-05-27 00:06:39 +02:00
parent 166482601d
commit b1637c5ef1
2 changed files with 10 additions and 1 deletions

View File

@ -321,7 +321,9 @@ struct FavoriteItemView: View {
itemLabel
.foregroundColor(.accentColor)
}
#if !os(tvOS)
.buttonStyle(.plain)
#endif
}
var itemNavigationLink: some View {

View File

@ -27,9 +27,11 @@ struct AccentButton: View {
.frame(maxWidth: maxWidth)
.contentShape(Rectangle())
}
#if !os(tvOS)
.foregroundColor(.accentColor)
.buttonStyle(.plain)
.background(buttonBackground)
#endif
}
var buttonBackground: some View {
@ -40,6 +42,11 @@ struct AccentButton: View {
struct OpenVideosButton_Previews: PreviewProvider {
static var previews: some View {
VStack {
AccentButton(text: "Open Videos", imageSystemName: "play.circle.fill")
.padding(.horizontal, 100)
AccentButton(text: "Open Videos", imageSystemName: "play.circle.fill")
.padding(.horizontal, 100)
}
}
}