Post

Replies

Boosts

Views

Created

[SwiftUI] swipeAction Button .tint doesn't work
Why Button {...}.tint(.color) doesn't color swipe buttons? Button remains gray. import SwiftUI struct ContentView: View { @State var isDeleted = false var body: some View { NavigationView { List{ Section { if !isDeleted { Link(destination: URL(string: "http://google.com")!){ HStack { Label("Google", systemImage: "magnifyingglass") Spacer() Image(systemName: "link") } .swipeActions(edge: .leading, allowsFullSwipe: true) { Button { isDeleted.toggle() } label: { Image(systemName: "trash") }.tint(.red) Button { } label: { Label("Pin", systemImage: "pin") }.tint(.yellow) } } } Link(destination: URL(string: "http://youtube.com")!){ HStack { Label("Youtube", systemImage: "tv") Spacer() Image(systemName: "link") } } } } .listStyle(.insetGrouped) .navigationTitle("List") } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
1
1
1.5k
Dec ’22