[我在应用中使用了选择器控件,当我在iOS 11专业版设备上运行时,标题文本的字体大小比实际字体大]]
<CustomControl:BindablePicker x:Name="pick" Font="lato-regular" FontSize="12" Title="{Binding Placeholder}" ItemsSource="{Binding Season}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" HorizontalOptions="FillAndExpand" BorderWidth="1" />
iOS渲染器:
protected override void OnElementChanged(ElementChangedEventArgs<Picker> e) { var view = (BindablePicker)Element; if (view != null && Control != null) { SetFont(view); } } void SetFont(BindablePicker view) { var fontsize = view.FontSize; var font = UIKit.UIFont.FromName("lato-regular", (System.nfloat)fontsize); if (font != null) { Control.Font = UIFont.SystemFontOfSize((System.nfloat)fontsize); Control.Font = font; } }
iOS上的输出:
我在我的应用中使用了选择器控件,当我在iOS 11专业版设备上运行时,标题文本字体大小显示为大于其实际字体大小
iOS中Picker的标题文本不是Control