我需要将statusbarstyle更改为Black,但我不知道该怎么做...

Index.xml:

<Alloy>
    <Widget id="drawer" src="nl.fokkezb.drawer">
        <Window role="leftWindow" module="xp.ui">

        </Window>
        <NavigationWindow id="navWindow" platform="ios" role="centerWindow">
            <Window >
                <LeftNavButton>
                    <Button id="leftButton" onClick="toggleLeft">ICON</Button>
                </LeftNavButton>
                <RightNavButton>
                    <Button id="rightButton">ICON</Button>
                </RightNavButton>
            </Window>
        </NavigationWindow>
        <View platform="android" role="centerWindow">

        </View>
    </Widget>
</Alloy>

这是Index.tss类
"#drawer": {
    openDrawerGestureMode: "OPEN_MODE_ALL",
    closeDrawerGestureMode: "CLOSE_MODE_ALL",
    leftDrawerWidth: 200,
    exitOnClose: true,
    navBarHidden: true,
    fullscreen: true,
statusBarStyle: "STATUSBAR_BLACK"
    },

最佳答案

Titanium.UI.Window.statusBarStyle property接受以下值之一:

  • Titanium.UI.iPhone.StatusBar.DEFAULT
  • Titanium.UI.iPhone.StatusBar.GRAY
  • Titanium.UI.iPhone.StatusBar.GREY
  • Titanium.UI.iPhone.StatusBar.LIGHT_CONTENT
  • Titanium.UI.iPhone.StatusBar.OPAQUE_BLACK
  • Titanium.UI.iPhone.StatusBar.TRANSLUCENT_BLACK

  • 您可以尝试以下代码:
    "#drawer": {
        openDrawerGestureMode: "OPEN_MODE_ALL",
        closeDrawerGestureMode: "CLOSE_MODE_ALL",
        leftDrawerWidth: 200,
        exitOnClose: true,
        navBarHidden: true,
        fullscreen: true,
        statusBarStyle: Ti.UI.iPhone.StatusBar.OPAQUE_BLACK,
    }
    

    还要确保#drawer指向Window视图元素。我不知道您的小部件抽屉如何工作。

    关于ios - Alloy nl.fokkezb.drawer小部件更改statusbarstyle,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23080057/

    10-10 20:36