diff --git a/src/Plugin.Iconize/Platform/Android/Renderers/IconButtonRenderer.cs b/src/Plugin.Iconize/Platform/Android/Renderers/IconButtonRenderer.cs index 98d8b58..0ebee7b 100644 --- a/src/Plugin.Iconize/Platform/Android/Renderers/IconButtonRenderer.cs +++ b/src/Plugin.Iconize/Platform/Android/Renderers/IconButtonRenderer.cs @@ -124,24 +124,34 @@ private void UpdateText() #if USE_FASTRENDERERS TextChanged -= OnTextChanged; - var icon = Iconize.FindIconForKey(Button.Text); - if (!(icon is null)) + var icons = Element.Text.Split("|"); + var controlText = string.Empty; + foreach (var iconText in icons) { - Text = $"{icon.Character}"; - Typeface = Iconize.FindModuleOf(icon).ToTypeface(Context); + var icon = Iconize.FindIconForKey(iconText); + if (!(icon is null)) + { + Text += $"{icon.Character}"; + Typeface = Iconize.FindModuleOf(icon).ToTypeface(Context); + } } - + TextChanged += OnTextChanged; #else if (!(Control is null)) { Control.TextChanged -= OnTextChanged; - var icon = Iconize.FindIconForKey(Button.Text); - if (!(icon is null)) + var icons = Element.Text.Split("|"); + var controlText = string.Empty; + foreach (var iconText in icons) { - Control.Text = $"{icon.Character}"; - Control.Typeface = Iconize.FindModuleOf(icon).ToTypeface(Context); + var icon = Iconize.FindIconForKey(iconText); + if (!(icon is null)) + { + Control.Text += $"{icon.Character}"; + Control.Typeface = Iconize.FindModuleOf(icon).ToTypeface(Context); + } } Control.TextChanged += OnTextChanged; diff --git a/src/Plugin.Iconize/Platform/Android/Renderers/IconLabelRenderer.cs b/src/Plugin.Iconize/Platform/Android/Renderers/IconLabelRenderer.cs index 3cc75e3..e378fb9 100644 --- a/src/Plugin.Iconize/Platform/Android/Renderers/IconLabelRenderer.cs +++ b/src/Plugin.Iconize/Platform/Android/Renderers/IconLabelRenderer.cs @@ -110,24 +110,34 @@ private void UpdateText() #if USE_FASTRENDERERS TextChanged -= OnTextChanged; - var icon = Iconize.FindIconForKey(Label.Text); - if (!(icon is null)) + var icons = Element.Text.Split("|"); + var controlText = string.Empty; + foreach (var iconText in icons) { - Text = $"{icon.Character}"; - Typeface = Iconize.FindModuleOf(icon).ToTypeface(Context); + var icon = Iconize.FindIconForKey(iconText); + if (!(icon is null)) + { + Text += $"{icon.Character}"; + Typeface = Iconize.FindModuleOf(icon).ToTypeface(Context); + } } - + TextChanged += OnTextChanged; #else if (!(Control is null)) { Control.TextChanged -= OnTextChanged; - var icon = Iconize.FindIconForKey(Label.Text); - if (!(icon is null)) + var icons = Element.Text.Split("|"); + var controlText = string.Empty; + foreach (var iconText in icons) { - Control.Text = $"{icon.Character}"; - Control.Typeface = Iconize.FindModuleOf(icon).ToTypeface(Context); + var icon = Iconize.FindIconForKey(iconText); + if (!(icon is null)) + { + Control.Text += $"{icon.Character}"; + Control.Typeface = Iconize.FindModuleOf(icon).ToTypeface(Context); + } } Control.TextChanged += OnTextChanged; diff --git a/src/Plugin.Iconize/Platform/iOS/Renderers/IconButtonRenderer.cs b/src/Plugin.Iconize/Platform/iOS/Renderers/IconButtonRenderer.cs index dc618f1..45b1135 100644 --- a/src/Plugin.Iconize/Platform/iOS/Renderers/IconButtonRenderer.cs +++ b/src/Plugin.Iconize/Platform/iOS/Renderers/IconButtonRenderer.cs @@ -60,16 +60,24 @@ protected override void OnElementPropertyChanged(Object sender, PropertyChangedE /// private void UpdateText() { - var icon = Iconize.FindIconForKey(Element.Text); - if (!(icon is null)) + var icons = Element.Text.Split("|"); + UIFont font = null; + var controlText = string.Empty; + foreach (var iconText in icons) { - var font = Iconize.FindModuleOf(icon)?.ToUIFont((nfloat)Element.FontSize); - if (!(font is null)) + var icon = Iconize.FindIconForKey(iconText); + if (!(icon is null)) { - Control.SetTitle($"{icon.Character}", UIControlState.Normal); - Control.Font = font; + font = Iconize.FindModuleOf(icon)?.ToUIFont((nfloat)Element.FontSize); + controlText += icon.Character; } } + + if (!(font is null)) + { + Control.SetTitle($"{controlText}", UIControlState.Normal); + Control.Font = font; + } } } } \ No newline at end of file diff --git a/src/Plugin.Iconize/Platform/iOS/Renderers/IconLabelRenderer.cs b/src/Plugin.Iconize/Platform/iOS/Renderers/IconLabelRenderer.cs index fe21f92..4ff18a5 100644 --- a/src/Plugin.Iconize/Platform/iOS/Renderers/IconLabelRenderer.cs +++ b/src/Plugin.Iconize/Platform/iOS/Renderers/IconLabelRenderer.cs @@ -59,16 +59,21 @@ protected override void OnElementPropertyChanged(Object sender, PropertyChangedE /// private void UpdateText() { - var icon = Iconize.FindIconForKey(Element.Text); - if (!(icon is null)) + var icons = Element.Text.Split("|"); + var controlText = string.Empty; + foreach (var iconText in icons) { - var font = Iconize.FindModuleOf(icon)?.ToUIFont((nfloat)Element.FontSize); - if (!(font is null)) + var icon = Iconize.FindIconForKey(iconText); + if (!(icon is null)) { - Control.Text = $"{icon.Character}"; - Control.Font = font; + var font = Iconize.FindModuleOf(icon)?.ToUIFont((nfloat)Element.FontSize); + if (!(font is null)) + { + Control.Text += $"{controlText}"; + Control.Font = font; + } } - } + } } } } \ No newline at end of file