Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add primaryBackgroundStyle option to splitView #6419

Merged
merged 1 commit into from Jul 26, 2020

Conversation

frane
Copy link
Contributor

@frane frane commented Jul 22, 2020

This PR adds the primaryBackgroundStyle option in splitView to enable translucent sidebars when developing Mac Catalyst apps. Like splitView it's iOS only and requires iOS 13+, the moment it seems to only have an effect on Mac apps and not affect apps running on iOS, see: https://developer.apple.com/documentation/uikit/uisplitviewcontroller/3238075-primarybackgroundstyle

The following layout

Navigation.events().registerAppLaunchedListener(() => {
    Navigation.setDefaultOptions({
        layout: {
            backgroundColor: 'transparent',
            componentBackgroundColor: 'transparent',
        },
        topBar: { 
            background: {translucent: true, blur: true},
            visible: false,
        }, 
    });
    Navigation.setRoot({
        root: {
            splitView: {
                master: {
                    stack: {
                        children: [
                            {
                                component: {
                                    name: 'Sidebar',
                                },
                            },
                        ],
                    },
                },
                detail: {
                    stack: {
                        children: [
                            {
                                component: {
                                    name: 'Main',
                                },
                            },
                        ],
                    },
                },
                options: {
                    displayMode: 'visible',
                    splitView: {
                       primaryBackgroundStyle: 'sidebar',
                    }
                },
            },
        },
    });
});

will produce something like this:

Screen Shot 2020-07-22 at 17 20 09

@yogevbd yogevbd merged commit 9ba863a into wix:master Jul 26, 2020
@guyca guyca mentioned this pull request Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants