How do I modify the background color of a List in SwiftUI?

后端 未结 14 1315
醉酒成梦
醉酒成梦 2020-12-03 02:33

I\'m trying to recreate an UI I built with UIKit in SwiftUI but I\'m running into some minor issues.

I want the change the color of the List here, but n

14条回答
  •  失恋的感觉
    2020-12-03 02:55

    I was able to get the whole list to change color by using colorMultiply(Color:). Just add this modifier to the end of the list view, and then the padding will push the table to the device edges. For example:

    List {...}.colorMultiply(Color.green).padding(.top)
    

    https://www.hackingwithswift.com/quick-start/swiftui/how-to-adjust-views-by-tinting-and-desaturating-and-more

提交回复
热议问题