SwiftUI: unwanted split view on iPad

后端 未结 2 1541
自闭症患者
自闭症患者 2020-12-14 06:53

Problem: a view on Pad shows up with unwanted split view.

My current setup is: Catalina OSX beta 5 + Xcode 11 Beta 5

Here is the c

2条回答
  •  天命终不由人
    2020-12-14 07:19

    To use this split style for iPad but remove for iPhone:

        extension View{
        func phoneOnlyStackNavigationView() ->some View{
    
            if UIDevice.current.userInterfaceIdiom == .phone{
                return AnyView(self.navigationViewStyle(StackNavigationViewStyle()))
            }else{
                return AnyView(self)
            }
        }
    }
    

提交回复
热议问题