【问题标题】:Nativescript Vue: Why does position of code matter in a Dock Layout matter?Nativescript Vue:为什么代码位置在 Dock 布局中很重要?
【发布时间】:2019-10-23 07:06:24
【问题描述】:

为什么下面的代码会产生这个结果:https://imgur.com/a/lQhLs8o
但是,如果我将BottomNavigatorBar 组件移动到CountryListComponent 之前的顶部位置,它会产生如下所示的预期结果:https://imgur.com/a/23z7bb2

<template>
  <Page actionBarHidden="true">
      <DockLayout height="100%">

         // first
         <CountryListComponent dock="top">

         // second
          <BottomNavigationBar dock="bottom" activeColor="pink"
                            inactiveColor="yellow"
                            backgroundColor="black"
                            verticalAlignment="bottom"
                            @tabSelected="this.changeTab"
                            row="1">
              <BottomNavigationTab title="Fiaarst" icon="icon-29.png" />
              <BottomNavigationTab title="Second" icon="icon-29.png" />
              <BottomNavigationTab title="Third" icon="icon-29.png" />
          </BottomNavigationBar>

      </DockLayout>
  </Page>
</template>

CountryListComponent

<template>
        <StackLayout backgroundColor="blue">
        </StackLayout>
</template>

【问题讨论】:

    标签: nativescript nativescript-vue


    【解决方案1】:

    引用DockLayout documentation,默认情况下stretchLastChild 将是true,这意味着BottomNavigationBar 将占用整个空间,如果它是最后一个孩子,反之亦然。

    【讨论】:

      猜你喜欢
      • 2022-12-11
      • 2015-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 2016-11-23
      相关资源
      最近更新 更多