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
Post a Comment