FontSize Windows Phone Renderer

Hi All, I need to change FontSize in an Entry Xamarin Forms Control. I create a render for iOS and Android and all work fine but... Windows Phone NO.
Does anyone know how you can change the Font Size?
Thanks

Answers

  • JefersonKalLynsJefersonKalLyns BRMember ✭✭

    Hey @PaoloCristina, in my case I tried to use the method Font Size, but does not work, but it may work for you. Here is the CustomRenderer:

    using Xamarin.Forms.Platform.WinRT;
    using Xamarin.Forms;
    using Windows.UI.Xaml.Media;
    using Windows.UI;
    
    [assembly: ExportRenderer(typeof(MyCustomEntry), typeof(MyCustomEntryRenderer))]
    namespace Namespace.WinPhone
    {
        public class CustomEntryRenderer : EntryRenderer
        {
            protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
            {
                base.OnElementChanged(e);
    
                if(Control != null)
                {
                    Control.FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Entry));
    
                    //or this
    
                    Control.FontSize = 10;
                }
            }
        }
    }
    
  • RobertoCataniaRobertoCatania USMember ✭✭

    It doesn't work! The font size is always the same, even if I use
    Control.FontSize = 10
    or
    Control.FontSize = 100
    or
    Control.FontSize = 5

    Any idea to resolve this situation?

Sign In or Register to comment.