简体   繁体   中英

UISplitView with preferredDisplayMode primaryOverlay covers entire screen and overlaps UITabbar

I am trying to use UISplitView in UITabBar. I want master(left side view) splitview to act as a Slide Menu for which I have set splitview property preferredDisplayMode 'primaryOverlay' which can overlay detail screen and goes back on selecting item from menu.

But here the master view covers the entire screen including UITabbar. Can we have any solution that can just overlay the screen above UITabBar so that TabBar remains accessible?

Attaching the screenshot for clear idea..

在此输入图像描述

UISplitViewController by default presents primary view as overlay when in portrait mode. You will have to subclass UISplitViewController and then force it to show all the time like,

splitViewController.preferredDisplayMode = .allVisible

As far as I know, Apple recommends you to use Split view controller as the root view controller of your application.

But if you want to use tab bar controller as root and if you don't want the split view to be overlapping over the tab bar then, you need to make use of container view controller by using UIContainerView and then embed your split view controller inside the container view.This will solve what you are expecting,I guess

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM