【问题标题】:Appcelerator Titanium: Cannot set TabGroup Nav Bar to hiddenAppcelerator Titanium:无法将 TabGroup 导航栏设置为隐藏
【发布时间】:2014-02-17 16:40:49
【问题描述】:

我正在尝试使用钛合金中的 TabGroup,但隐藏了屏幕底部的选项卡组按钮。

在他们的文档中有一个名为navBarHidden 的属性,它说如果设置为true,它将隐藏栏。但它不起作用。

<Window>
    <TabGroup id="mainTabGroup" navBarHidden="true" class="container">
        <Tab id="tab1" title="Tab 1">
            <Window id="win1" title="Tab 1">
               <Label id="label1" color="#999">I am Window 1</Label>
            </Window>
        </Tab>
        <Tab id="tab2" title="Tab 2">
            <Window id="win2" title="Tab 2">
                <Label id="label2" color="#999">I am Window 2</Label>
            </Window>
        </Tab>
        <!-- Use the Require tag to include external Ti.UI.Tab views -->
    </TabGroup>
</Window>

我错过了什么吗?

【问题讨论】:

  • 你是在安卓还是ios上编程?
  • 如果可能的话,两者都适合?
  • navBarHidden 仅适用于 android
  • 无论如何尝试 yourWindow.hideNavBar();最好在事件监听器中

标签: javascript titanium appcelerator titanium-alloy


【解决方案1】:

我发现了问题。我需要在选项卡元素中放置一个窗口,然后添加 tabBarHidden 属性。所以我的视图 XML 文件看起来像这样:

<TabGroup id="mainTabGroup">

    <Tab>
        <Window id="mainWindow" title="The Title" tabBarHidden="true">

        </Window>
    </Tab>

</TabGroup>

在我的控制器中:

$.mainTabGroup.open();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-04
    • 1970-01-01
    相关资源
    最近更新 更多