Post

Replies

Boosts

Views

Activity

Reply to Custom view doesn't load properly when presented as a modal sheet
Hey @OOPer! Thanks for your reply, it was helpful. When you said the problem should be easily reproducable I started to add every element of the code to a blank view one by one. var body: some View {     VStack() {       CurrencyList(selectedCurrencies: watchedCurrencies)       Button("Szerkesztés"){         isSelectorOpen = true       }       .sheet(isPresented: $isSelectorOpen){         CurrencySelectorView().environmentObject(watchedCurrencies)       }.foregroundColor(.white).background(RoundedRectangle(cornerRadius: 50.0).frame(width: 120, height: 40).foregroundColor(.blue)).padding()             }   } Turns out, the problem was this piece of code. I meant to apply these color and frame modifiers to the edit button, but because of its placement, it was applied to the content of the sheet too, so it painted the text white, thats why it disappeared.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21