SwiftUI - Navigation bar button not clickable after sheet has been presented

前端 未结 5 800
攒了一身酷
攒了一身酷 2020-12-14 17:39

I have just started using SwiftUI a couple of weeks ago and i\'m learning. Today I ran into a into an issue.

When I present a sheet with a navigationBarItems-button

5条回答
  •  时光说笑
    2020-12-14 18:20

    This seems to be a bug in SwiftUI. I am also still seeing this issue with Xcode 11.5 / iOS 13.5.1. The navigationBarMode didn't make a difference.

    I filed an issue with Apple:


    FB7641003 - Taps on a navigationBarItem Button presenting a sheet sometimes not recognized

    You can use the attached example project SwiftUISheet (also available via https://github.com/ralfebert/SwiftUISheet) to reproduce the issue. It just presents a sheet from a navigation bar button. Run the app and tap repeatedly on the 'plus' button in the nav bar. When the sheet pops up, dismiss it by sliding it down. Only some taps to the button will be handled, often a tap is ignored.

    Tested on Xcode 11.4 (11E146) with iOS 13.4 (17E255).

提交回复
热议问题