Home IOS Development ios – How Can I Change The Background Colour of A Listing View Row Factor’s Press State in SwiftUI?

ios – How Can I Change The Background Colour of A Listing View Row Factor’s Press State in SwiftUI?

0
ios – How Can I Change The Background Colour of A Listing View Row Factor’s Press State in SwiftUI?

[ad_1]

So I understand how to alter the background shade of an inventory row ingredient in swiftUI utilizing .listRowBackground(Colour.pink) for instance. However after I do that the row not adjustments shade if you press it. Observe I don’t imply the energetic row… I imply when your finger is urgent down on the row I need it to alter shade as visible suggestions. Any strategies on how I can retain the press state background shade? And even higher how can I customise that press shade?

This is the code I am taking part in with:

Listing {
     ForEach((viewModel.bookmarks )!, id: .id) { bookmark in
         Button(motion: {onTap(bookmark)}, label: {
                            BookmarkCell(label: bookmark.trackName,
                                         createAt: bookmark.date.bookmarkFormat(),
                                         savePosition: bookmark.place.format(formatType: FormatType.hhmmss),
                                         word: bookmark.word)
                        }).listRowBackground(Colour.pink) // for testing
    }
}

Any strategies could be enormously appreciated.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here