【问题标题】:Is there any way to change the Picker Title FontSize and FontFamily in PCL project有什么方法可以更改 PCL 项目中的 Picker Title FontSize 和 FontFamily
【发布时间】:2017-10-25 23:24:04
【问题描述】:

这是我的选择器

<Picker  Grid.Row="1"  
         Grid.Column="3" 
         Title="Select LeaveType" 
         ItemsSource="{Binding LeaveTypeCollection, Mode=TwoWay}"
         ItemDisplayBinding="{Binding Value}" 
         SelectedItem="{Binding SelectedLeaveType}" 
         HorizontalOptions="FillAndExpand"/>

我想将标题 Fontsize 和 FontFamily 添加到 选择器有人可以帮助我解决这个问题,谢谢。

【问题讨论】:

  • 这是我要更改的选择器

标签: c# xaml xamarin.forms


【解决方案1】:

不幸的是,Xamarin Picker 控件没有公开这些属性,您需要实施某种解决方法。

在 Xamarin 论坛上有一些关于此的聊天,a workaround detailed here that uses a label with a hidden picker,点击标签时会显示选择器。这允许使用您的字体大小和字体系列自定义标签,以提供样式选择器的外观。

还有一些答案to this question 详细说明了如何使用自定义渲染器来解决您的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-01
    • 1970-01-01
    • 2023-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-20
    相关资源
    最近更新 更多