简体   繁体   English

带angular2的Nativescript脚栏

[英]Nativescript footbar with angular2

I am very new to Nativescript UI. 我对Nativescript UI非常陌生。 How can I place footer in Nativescript with angular2. 如何使用angular2将页脚放在Nativescript中。

I am designing page with tabs. 我正在设计带有标签的页面。 where i need to show list view and footer in one tab. 我需要在一个选项卡中显示列表视图和页脚。 List view is working perfect as like in below image. 列表视图完美工作,如下图所示。 My concern is to design footer and fab button. 我关心的是设计页脚和fab按钮。 I don't have much experience on changes. 我对变更没有太多经验。

Code follows : 代码如下:

<TabView [selectedIndex]="tabindex" selectedColor="#FF0000">
<StackLayout *tabItem="{title: 'Appertiser'}" >
    <Label text="Hello, I am Appertiser" marginTop="20" fontSize="20" horizontalAlignment="center" textAlignment="center"></Label>
</StackLayout>
<StackLayout *tabItem="{title: 'Noodles'}" >
    <ListView [items]="products">
        <template let-item="item">
            <GridLayout  rows="auto" columns="auto,*" class="list-wrapper">
                <Image  row="0" col="0" [src]="item.productImage" horizontalAlignment="left"></Image>
                <StackLayout row="0" col="1" orientation="vertical" horizontalAlignment="left" class="productDetail">
                    <Label [text]='item.productName' horizontalAlignment="left" class="productHeading"></Label>
                    <Label [text]='item.productShortDescription'  horizontalAlignment="left" class="productDescription"></Label>
                    <Label [text]='item.productTags'  horizontalAlignment="left" class="productTags"></Label>
                </StackLayout>
                <Image row="0" col="2" [src]="item.iconImage" width="20px" height="20px" horizontalAlignment="right"  verticalAlignment="top" marginRight="10"></Image>
                <GridLayout row="0" col="3" orientation="vertical" verticalAlignment="bottom">
                    <Label [text]='item.productPrice' class="productPrice" textColor="red" horizontalAlignment="right" class="productPrice"></Label>
                </GridLayout>
            </GridLayout>
        </template>

    </ListView>

    <FAB (tap)="toggleNav('Home')" rippleColor="#f1f1f1" class="fab-button"></FAB>


</StackLayout>
<StackLayout *tabItem="{title: 'Seafood'}">
    <Label text="Hello, I am Seafood" marginTop="20" fontSize="20"  textAlignment="left"></Label>

    <GridLayout row="1" column="0" rows="auto" columns="50,*,50" verticalAlignment="bottom" backgroundColor="lightgray" cssClass="footer">
        <Label text="My cat loves the camera" textWrap="true" col="1" colSpan="2" minHeight="50" fontSize="20" margin="3"></Label>
        <Label text="John Smith" col="1" row="1" fontSize="14" horizontalAlignment="left" verticalAlignment="bottom" margin="3"></Label>
        <Label text="comments: 26" col="2" row="1" color="#10C2B0" fontSize="14" verticalAlignment="bottom" margin="3"></Label>
    </GridLayout>
    <GridLayout cssClass="footer" row="1" column="0" rows="auto" columns="50,*,50">
        <Image src="{{flag}}" cssClass="flagimage" col="0" row="0"></Image>
        <Label text="{{lang}}" tap="{{goDefault}}" col="1" row="0" textAlignment="left"></Label>
        <Image src="~/res/icons/white/ellipsis_white.png" cssClass="iconwhitesmall" tap="{{goOther}}" row="0" col="2"></Image>
    </GridLayout>

</StackLayout>

In order to get familiar with NativeScript + Angular-2 I wo8uld recommend to check out this sample app where a number of basic scenarios are shown. 为了熟悉NativeScript + Angular-2,我建议您查看这个示例应用程序 ,其中显示了一些基本方案。

As for your question - What exactly do you mean by "footer" !? 至于您的问题-“页脚”到底是什么意思! A semantic footer layout for main page or menu or maybe a footer for list-view controller ? 用于主页或菜单的语义页脚布局 ,或者用于列表视图控制器页脚 The answer depends on your specific needs so please share a code of what you have done so far and what you are trying to achieve. 答案取决于您的特定需求,因此请分享您到目前为止所做的以及您要实现的目标的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM