summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs28
1 files changed, 18 insertions, 10 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
index d21d3d76..24e93bca 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
@@ -54,17 +54,25 @@ namespace Xamarin.Forms.Platform.Tizen
Native.FormattedString nativeString = new Native.FormattedString();
- foreach (var element in formattedString.Spans)
+ foreach (var span in formattedString.Spans)
{
- Native.Span span = new Native.Span();
- span.FormattedText = element.Text;
- span.FontAttributes = element.FontAttributes;
- span.FontFamily = element.FontFamily;
- span.FontSize = element.FontSize;
- span.ForegroundColor = element.ForegroundColor.IsDefault ? s_defaultForegroundColor : element.ForegroundColor.ToNative();
- span.BackgroundColor = element.BackgroundColor.IsDefault ? s_defaultBackgroundColor : element.BackgroundColor.ToNative();
-
- nativeString.Spans.Add(span);
+ Native.Span nativeSpan = new Native.Span();
+ nativeSpan.FormattedText = span.Text;
+ nativeSpan.FontAttributes = span.FontAttributes == FontAttributes.None ? Element.FontAttributes : span.FontAttributes;
+ nativeSpan.FontFamily = span.FontFamily == null ? Element.FontFamily : span.FontFamily;
+ nativeSpan.FontSize = span.FontSize == Device.GetNamedSize(NamedSize.Default, typeof(Label), true) ? Element.FontSize : span.FontSize;
+
+ if (span.ForegroundColor.IsDefault)
+ nativeSpan.ForegroundColor = Element.TextColor.IsDefault ? s_defaultForegroundColor : Element.TextColor.ToNative();
+ else
+ nativeSpan.ForegroundColor = span.ForegroundColor.ToNative();
+
+ if (span.BackgroundColor.IsDefault)
+ nativeSpan.BackgroundColor = Element.BackgroundColor.IsDefault ? s_defaultBackgroundColor : Element.BackgroundColor.ToNative();
+ else
+ nativeSpan.BackgroundColor = span.BackgroundColor.ToNative();
+
+ nativeString.Spans.Add(nativeSpan);
}
return nativeString;