How to determine the text color and/or background color of a List Item in SwiftUI?

64 Views Asked by At

I use in a List View inside of a Split View. On the iPad and in Mac Catalyst, the items are displayed with different background colors (blue, gray) when selected. A Text View automatically adjusts the text color. But if I want to use other views or modify the text color in a search, I need the text color and/or the background color of the item. If you use a UITableViewCell in UIKit, this query is simple. For an app in SwiftUI I haven't found a solution yet.

enter image description here

enter image description here

Does anyone have an idea how to determine the text color and/or background color?

0

There are 0 best solutions below