【问题标题】:How to change the fontfamily of items in flyoutpicker of combobox in wp8.1如何在wp8.1的组合框的flyoutpicker中更改项目的fontfamily
【发布时间】:2023-03-07 17:40:01
【问题描述】:

谁能解释一下,如何更改flyoutpicker的字体族(组合框中有5个以上项目时出现的溢出菜单)?

我尝试了很多方法,但无法得到解决方案。

请帮忙。

截图链接-> http://i.stack.imgur.com/237XW.png

我设法改变了标题字体[用黄色矩形标记]和背景颜色[用红色*标记]

但我想更改文本的字体系列[用红色矩形标记]。

请帮帮我……

【问题讨论】:

    标签: xaml combobox windows-phone-8.1 font-family


    【解决方案1】:

    尝试覆盖 ListPickerFlyoutPresenter

    <Style TargetType="ListPickerFlyoutPresenter">
        <Setter Property="FontFamily" Value="{StaticResource MyFontFamily" />
    <Style/>
    

    更新:

    您需要覆盖以下 DataTemplate 来自定义 FontFamily

    <!-- DataTemplate holding the content for ListPickerFlyoutPresenter's ItemsHostPanel -->
    <DataTemplate x:Key="ListPickerFlyoutPresenterContentTemplate">
        <ListView>
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="FontSize" Value="32"/>
                    <Setter Property="FontFamily" Value="{StaticResource LoraBoldFontFamily}"/>
                </Style>
            </ListView.ItemContainerStyle>
            <ListView.Footer>
                <Border Height="{ThemeResource ListPickerFlyoutFooterThemeHeight}" Width="1" />
            </ListView.Footer>
        </ListView>
    </DataTemplate>
    

    OneDrive下载样本

    【讨论】:

    • 我没有得到我想要的... :-(
    • 您想更改列表选择器弹出窗口中组合框项目的字体系列 :)
    • 但我无法做到这一点......我正在尝试 2 天...... :-(
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-30
    • 2015-09-30
    • 1970-01-01
    相关资源
    最近更新 更多