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

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

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

html - jQuery UI Sortable - Remove placeholder after item is dropped -