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

后端 未结 14 1282
醉酒成梦
醉酒成梦 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 03:13

    For me, a perfect solution to change the background of List in SwiftUI is:

    struct SomeView: View {
        init(){
        UITableView.appearance().backgroundColor = UIColor(named: "backgroundLight")
          }
    ...
    
    }
    
    0 讨论(0)
  • 2020-12-03 03:13

    If anyone came here looking for solutions for background in landscape not full width on iPhone X/11 try:

    .listRowBackground(Color("backgroundColour").edgesIgnoringSafeArea(.all))
    
    0 讨论(0)
提交回复
热议问题