c# - Apply italic effect in the part of Text property of Label in Xamarin.forms -


this snippet in xamarin.forms.

grid.children.add (new label {text = "italic, bold",                             xalign = textalignment.center,                             yalign = textalignment.center,                             fontsize = 30                         }, 1, 1); 

i need make "italic" italic font , bold "bold".

can me?

i solved it.

var fs = new formattedstring (); fs.spans.add (new span { text="italic", foregroundcolor = color.gray, fontsize = 20, fontattributes = fontattributes.italic }); fs.spans.add (new span { text=", bold", foregroundcolor = color.gray, fontsize = 20, fontattributes = fontattributes.bold }); labelformatted.formattedtext = fs; 

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -