How to create Formatted String programmarly



how to create Formatted String programmarly?

I have some dynamic text to display with part of them needs to be different font. I wish to create Formatted String programmarly, can anyone instruct me how to do that?

… or how to create text with same result as:

      <Span text="NativeScript" foregroundColor="#3C5AFD"></Span>
      <Span fontFamily="somefont" text=" is an "></Span>
      <Span text="AMAZING" fontSize="28" underline="true" backgroundColor="green" foregroundColor="white" fontFamily="Courier"></Span>
      <Span fontFamily="somefont2" text=" framework."></Span>



Here you go


that’s perfect!!
thank you sooooo much


Sorry to bother you, but how to use it in RadListView.
I used this method in list view and all the text become the same.


Assign the formatted string to a attribute in data item, bind that attribute to the textfield in template.