在Xamarin.Forms中更改TextColor [英] Changing TextColor in Xamarin.Forms

查看:183
本文介绍了在Xamarin.Forms中更改TextColor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.我想在Xamarin.Forms项目中更改标签的文本颜色.我已经尝试使用FontColor,但是没有用.

Good Day Everyone. I want to change the text color of the Labels in my Xamarin.Forms project. I've already tried using FontColor but it didn't work.

在这里我要更改文本颜色.我希望名称部门为黄色.你能教我怎么做吗?非常感谢.

Here's where I want the text color to be changed. I want the Name and the Department to be color Yellow. Can you please teach me how? Thanks a lot.

        <Label Grid.Column="1"
          Text="{Binding Name}"
               FontSize="24"/>

        <Label Grid.Column="1"
               Grid.Row="1"
              Text="{Binding Department}"
               FontSize="18"
               Opacity="0.6"/>

推荐答案

使用 使用颜色:

TextColor="Yellow"

使用绑定:

TextColor="{Binding MyTextColor}"

这篇关于在Xamarin.Forms中更改TextColor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆