Hello, I use a @State variable to control display Grid, like this:
if(unit == "w"){
Grid(tracks: 3) {
ForEach(weekSelectArr.indices){item in
Toggle(isOn: self.$weekSelectArr[item]) {
Text(weekdays[item])
.frame(height:50)
}.toggleStyle(GridToggleStyle())
}
}.frame(height:200)
}
When the view appear, it shows like this: only show one item.

When I click the item, it come back into grid:

Their parent view is a Form->Section.