Reputation: 167
trying to follow Xamarin tutorial for a label view at : Label Tutorial
when applying italic font attribute in a span tag , while setting the size of the label text to any value in the label tag. the text size did not get applied to the text in the span with italic attribute.
<StackLayout Margin="20,35,20,25">
<Label FontSize="50" TextColor="Blue">
<Label.FormattedText>
<FormattedString>
<Span Text="underlined text" TextDecorations="Underline" />
<Span Text=", emphasized" FontAttributes="Italic" />
</FormattedString>
</Label.FormattedText>
</Label>
</StackLayout>
Upvotes: 2
Views: 387
Reputation: 12723
I also found that it when the span with Italic
attribute the FontSize
of Label can not work. However , I found a WorkAround for this , you can set FontSize
of this Span to solve it .
Have a look at follow code:
<StackLayout Margin="20,35,20,25">
<Label FontSize="50" TextColor="Blue">
<Label.FormattedText>
<FormattedString>
<Span Text="underlined text" TextDecorations="Underline" />
<Span Text=", emphasized" FontSize="50" FontAttributes="Italic" />
</FormattedString>
</Label.FormattedText>
</Label>
</StackLayout>
The effect :
I think next version of Xamarin Forms will fix it as soon as possible .
Upvotes: 4