Sunday, June 7, 2026
HomeiOS Developmentios - SwiftUI - The best way to set Record background to...

ios – SwiftUI – The best way to set Record background to clear?

[ad_1]

In SwiftUI it seems there are two choices for modifying colours to a listing.

  1. Set a listing’s row background coloration

    Record {        
      ForEach(components, id:.self) { aspect in
      }.listRowBackground(Colour.blue)
    }
    
  2. Set a listing’s coloration scheme to both ‘mild’ or ‘darkish’

     Record {        
       ForEach(components, id:.self) { aspect in
       }
     }.colorScheme(.mild) // .darkish
    

Setting different attributes like background, foreground coloration, and so forth… appears to have zero impact on the view coloration of curiosity.

For the time being I do have the Record embedded in a Navigation View as such:

NavigationView {
  Record {        
    ForEach(components, id:.self) { aspect in
    }
  }.colorScheme(.mild) // .darkish
}

However once more, no coloration settings or view hierarchy setup appear to allow to potential to set the background view to clear/clear so the colour of the principle view may be the driving force. Relatively it seems from experimentation that we’re pressured to decide on both a white or black background. Is that this a swift or Xcode bug or are there any options accessible?

enter image description here

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments