SwiftUI уволить поповер в NavigationBar - PullRequest
0 голосов
/ 19 октября 2019

У меня есть следующее представление:

struct ContentView: View {
    @State var isPresented = false
    var body: some View {
        ZStack{
            NavigationView{
                Text("Main")
                .navigationBarTitle("Popover Test", displayMode: .inline)
                .navigationBarItems(trailing:
                    Button(
                        action: { self.isPresented = true },
                        label: { Text("Open") }
                    ).popover(
                        isPresented: $isPresented,
                        content: {
                            Button(
                                action: { self.isPresented = false },
                                label: { Text("Close") }
                            )
                        }
                    )
                )
            }
            .navigationViewStyle(StackNavigationViewStyle())
        }
    }
}

Производит следующий вывод: enter image description here

Поповер не может быть отклонен ни с помощью кнопки, ни с вкладками снаружипоповера. Это ошибка или где моя ошибка?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...