开发者

UISplitViewController - BarButton Item not shown at start

开发者 https://www.devze.com 2023-01-13 20:22 出处:网络
I\'m having trouble showing a UISplitViewController programatically. I have two views, a UIView with buttons which when are pressed load my own custom RootViewController and DetailViewControllers int

I'm having trouble showing a UISplitViewController programatically.

I have two views, a UIView with buttons which when are pressed load my own custom RootViewController and DetailViewControllers into SplitViewController and then hides the menuSubview for showing UISplitViewController.

Well, it works well in portrait orientation, but when the view is shown the barButtonItem associated with the popOverViewController is not 开发者_如何学JAVAshown. After if I change orientation to landscape, then back to portrait again, the button appears.

Why does this happen? Is there any way to fix it?

I have a little idea. When splitviewController.view is added to the window, the root and detail view controllers are not set yet so could that be the cause?


Well at last I solved the error.

Instead adding two subviews and show/hide them, I add my splitViewController.view as principal to the window and presented the menuViewController as modal, so this issue was solved.

0

精彩评论

暂无评论...
验证码 换一张
取 消