【问题标题】:Can Nativescript 4.0 new Frame use more elements than Tabview or Sidedrawer?Nativescript 4.0 新 Frame 可以使用比 Tabview 或 Sidedrawer 更多的元素吗?
【发布时间】:2018-05-09 08:07:19
【问题描述】:

我发现 Frame 现在工作得更好了。 我们可以有 Tabview,它是当前视图的根。

<TabView androidTabsPosition="bottom">
    <TabViewItem title="First">
        <Frame defaultPage="home/home-page" />
    </TabViewItem>
    <TabViewItem title="Second">
        <Frame defaultPage="second/second-page" />
    </TabViewItem>
</TabView>

这看起来像是主页或第二页被“包含”了。

现在,我想知道是否可以让 app-root.xml 包含通用元素,并包含所需的页面。我试过了,但是这不起作用(为什么?这种方法只适用于 tabview 和 sidedrawer ?)

app-root.xml

<Page>
    <Frame defaultPage="create/create"></Frame>
</Page>

创建/创建.xml

<StackLayout class="footer white">
            <Label text="test"></Label>
</StackLayout>

【问题讨论】:

    标签: nativescript


    【解决方案1】:

    而不是Page 使用GridLayout 之类的布局,将t this test application 作为参考,更具体地说是this page

    但是,上述方法适用于 Android,但对于 iOS,您应该删除每个 Page 的操作栏(在每个 Frame 内)或创建多个操作栏(不推荐!)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-14
      • 1970-01-01
      • 2013-01-01
      • 1970-01-01
      相关资源
      最近更新 更多