Skip to content

Only show one item when view appear, click to restore #28

@AntoniotheFuture

Description

@AntoniotheFuture

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.
image

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

Their parent view is a Form->Section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions