gpt4 book ai didi

javascript - 在 TabView 中使用 Frame 标签时如何排除 ActionBar?

转载 作者:太空宇宙 更新时间:2023-11-04 06:17:04 26 4
gpt4 key购买 nike

我的问题

我在特定页面上使用简单的 TabView。

<Page class="page" navigatingTo="onNavigatingTo" xmlns="http://schemas.nativescript.org/tns.xsd">

<ActionBar class="action-bar">
<!--
Use the NavigationButton as a side-drawer button in Android
because ActionItems are shown on the right side of the ActionBar
-->
<NavigationButton ios:visibility="collapsed" icon="res://menu" tap="onDrawerButtonTap"></NavigationButton>
<!--
Use the ActionItem for IOS with position set to left. Using the
NavigationButton as a side-drawer button in iOS is not possible,
because its function is to always navigate back in the application.
-->
<ActionItem icon="res://navigation/menu" android:visibility="collapsed"
tap="onDrawerButtonTap" ios.position="left">
</ActionItem>
<Label class="action-bar-title" text="Browse"></Label>
</ActionBar>

<TabView androidTabsPosition="bottom">
<TabViewItem title="first tab">
<Frame defaultPage="home/home-page"></Frame>
</TabViewItem>
<TabViewItem title="2222 tab">
<Frame defaultPage="search/search-page"></Frame>
</TabViewItem>
</TabView>

</Page>

如您所见,当我们到达此页面时,我们会看到底部选项卡。但是当我们点击其中一个选项卡时,问题就出现了。

实际情况是,它正在导入整个页面,包括标题栏。

错误截图

Title Bar Erroneously Imported

理想的解决方案

我希望能够使用 Frame 标记将页面导入到我的 TabView 中,但在这样做时排除 ActionBar。

当我们直接导航到页面时,我确实希望显示操作栏。

这可能吗?如果是这样,你能指出我正确的方向吗?这是我的代码失败得很惨......

Online Demo in Playground

感谢观看,约翰

最佳答案

您可以设置 actionBarHidden属性(property)falsePage 上您不希望出现操作栏。

如果你不想整个Frame上的操作栏, 然后设置 actionBarVisibilityneverFrame 上本身。

    <TabView>
<TabViewItem title="first tab">
<Frame defaultPage="home/home-page" actionBarVisibility="never"></Frame>
</TabViewItem>
<TabViewItem title="2222 tab">
<Frame defaultPage="search/search-page" actionBarVisibility="never"></Frame>
</TabViewItem>
</TabView>

Updated Playground

关于javascript - 在 TabView 中使用 Frame 标签时如何排除 ActionBar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55860522/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com