首页 > 解决方案 > 使用 Nativescript 更改颜色和图标菜单

问题描述

我在所有组件中都有这个菜单:

<GridLayout rows="*,60">
    <StackLayout row="1" orientation="horizontal" class="foot" backgroundColor="#eae8e8" padding = "10 5 10 5" >
        <StackLayout [nsRouterLink]="['/home']" width="25%" textAlignment="center">
            <Image src="~/assets/images/home.png" width="20" height="20" stretch="aspectFit"></Image>
            <Label text="Home">
            </Label>
        </StackLayout>
        <StackLayout [nsRouterLink]="['/settings']" width="25%" textAlignment="center">
            <Image src="~/assets/images/settings.png" width="20" height="20" stretch="aspectFit"></Image>
            <Label text="Setting">
            </Label>
        </StackLayout>
        <StackLayout [nsRouterLink]="['/photos']" width="25%" textAlignment="center">
            <Image src="~/assets/images/photos.png" width="30" height="20" stretch="aspectFit"></Image>
            <Label text="Photos">
            </Label>
        </StackLayout>
        <StackLayout [nsRouterLink]="['/gallery']" width="25%" textAlignment="center">
            <Image src="~/assets/images/gallery.png" width="20" height="20" stretch="aspectFit"></Image>
            <Label text="Gallery">
            </Label>
        </StackLayout>
    </StackLayout>
</GridLayout>

我想要,当我单击菜单时更改文本中的颜色,像菜单 PlayGround 图像中的颜色图像

演示

标签: angularmenunativescript

解决方案


推荐阅读