我有一个绑定(bind)号码,我想在其之间添加空格。例如。目前它显示 123456789 ,我希望它显示 123 456 789 。有人知道如何使用 stringFormat 执行此操作吗?
我的xaml
<Label Text="{Binding CardNumber}" TextColor="#1481BA" />
最佳答案
您可以使用以下格式StringFormat={0:### ### ###}
例如
<Label Text="{Binding CardNumber, StringFormat={0:### ### ###}" TextColor="#1481BA" />
关于xaml - 使用 StringFormat、xamarin.forms 在 9 位绑定(bind)号码之间添加空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48095233/