How do I display “Android backspace” - ⌫ in Label

被刻印的时光 ゝ 提交于 2019-12-12 00:29:51

问题


I have a Xamarin application with a Label which is Bound like so:

<Label Text="{Binding BackSpace}"/>

and a property in my viewmodel like so:

public string BackSpace
{
   get
   {
        ResourceManager temp = new ResourceManager("MyProgram.ResourceStrings", typeof(MyClass).GetTypeInfo().Assembly);
        result = System.Text.RegularExpressions.Regex.Unescape(temp.GetString("Backspace"));
   }
}

now I have an element in my ResourceStrings called Backspace and I am trying to get the string associated with this key which I want to be the Android Backspace -

So initially I set the resource equal to the symbol but this just gives me a label containing ?

Now I try set it equal to the HTML hex code from here: &#x232b; but this gives me &#x232b;

How do I get my label to display the symbol?

PS. - Even if I try:

<Label Text="⌫"/>

I get a blank label


回答1:


You'll need to change your label's font to a font which contains backspace as glyphicon.

You'll need two things:

  • Appropriate font. Probably Noto Sans Symbols https://www.google.com/get/noto/#sans-zsym. ⌫ symbol
  • Label renderer which allows custom fonts. See here: https://github.com/XLabs/Xamarin-Forms-Labs/wiki/ExtendedLabel

This Xamarin link will provide more infomation on working with Fonts



来源:https://stackoverflow.com/questions/32351677/how-do-i-display-android-backspace-in-label

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!