How can I show text with html format in xamarin forms

前端 未结 4 632
无人共我
无人共我 2020-12-17 19:03

I work on webservice with json and i get text with html format. I want my text have hyperlinks and some other properties where i find from html tags (etc. bold).

I t

4条回答
  •  攒了一身酷
    2020-12-17 19:41

    FYI, I've just added the ability to my Forms9Patch library to create labels and buttons where you can format the text via HTML. For example:

    new Forms9Patch.Label { HtmlText =  "plain Bold+Italic plain"}
    

    ... would give you a label where the text has been formatted bold italic in the middle of the string.

    Also, as an aside, it allows you to use custom fonts that are embedded resources in your PCL project without any platform specific work. And, you can use these fonts via the HTLM tag or and HTML font-family attribute.

    Here are some screen shots from the demo app:

提交回复
热议问题