TabView(选项卡)在Nativescript中的自定义位置

时间:2019-05-15 16:02:10

标签: tabs nativescript angular2-nativescript tabview stacklayout

我正在为应用程序使用Nativescript和Angular。在页面的中间,我将添加两个选项卡,并在其下方添加它们的内容:

<TabView [(ngModel)]="tabSelectedIndex" selectedTabTextColor="#a81b38" tabBackgroundColor="#f5f5f5"
                tabTextFontSize="18" androidSelectedTabHighlightColor="#a81b38"
                (selectedIndexChange)="onSelectedIndexChanged($event)" androidTabsPosition="bottom">
<StackLayout *tabItem="{title: 'Details', iconSource: getIconSource('details')}">
    <Label text="my content 1"></Label>
</StackLayout>

<StackLayout *tabItem="{title: 'Prices', iconSource: getIconSource('prices')}">
    <Label text="my content 2"></Label>
</StackLayout>
</TabView>

所以:

--- PAGE START ----
 ...some page content....
 .... tabs ....
 .... content of selected tab ....
 ....other page content...
--- PAGE END ----

问题是我可以将TabView放在顶部或底部。我尝试将TabView包装到其中:

<StackLayout margin="50 0 0 0">
 ...tabs...
</StackLayout>

并且选项卡位置正确,但是它们不起作用(它们不会更改选项卡,并且我看不到选项卡的内容)。 那么,有没有办法自定义选项卡上的位置? 谢谢

0 个答案:

没有答案
相关问题