简体   繁体   中英

Entry font size Xamarin.Forms iOS

I am using xamarin forms and I want different font sizes for different platforms, for example i want my Android entries to have FontSize 14, and in iOS I want them to be FontSize 12, I can do it programatically with the code below, but is there any way to do it in XAML?

 if (Device.OS == TargetPlatform.iOS)
        {
            Entry.FontSize = 12;

        }
<Entry>
  <Entry.FontSize>
    <OnPlatform x:TypeArguments="x:Double"
      iOS="20"
      Android="25" />
  </Entry.FontSize>
</Entry>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM