【问题标题】:Change color text using Label使用标签更改颜色文本
【发布时间】:2018-07-09 08:50:13
【问题描述】:

使用Label Nativescript时如何改变菜单栏文字颜色。

我的代码:

        <StackLayout row="1" orientation="horizontal" backgroundColor="#eae8e8" class="foot">
            <Label width="25%" textAlignment="left" [nsRouterLink]="['/photos']">
                <FormattedString>
                    <Span text="Photos"></Span>
                </FormattedString>
            </Label>
   <Label width="25%" textAlignment="left" [nsRouterLink]="['/albums']">
                <FormattedString>
                    <Span text="Albums"></Span>
                </FormattedString>
            </Label>
         </StackLayout>

我想要这样点击时

【问题讨论】:

标签: html typescript xhtml nativescript


【解决方案1】:

您可以在 CSS 和直接 HTML 中使用 color 属性来指定元素的颜色。 例如:

zontal" backgroundColor="#eae8e8" class="foot">
            <Label width="25%" textAlignment="left" [nsRouterLink]="['/photos']">
                <FormattedString>
                    <Span color="blue" text="Photos"></Span>
                </FormattedString>
            </Label>
   <Label width="25%" textAlignment="left" [nsRouterLink]="['/albums']">
                <FormattedString>
                    <Span text="Albums"></Span>
                </FormattedString>
            </Label>
         </StackLayout>

这里是游乐场演示:https://play.nativescript.org/?template=play-ng&id=gMhuwo&v=2

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-08-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多