We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfAutoComplete property 'DropDownItemFontFamily' not being set.

Thread ID:

Created:

Updated:

Platform:

Replies:

149797 Dec 10,2019 12:37 AM UTC Dec 10,2019 08:44 AM UTC Xamarin.Forms 1
loading
Tags: SfAutoComplete
Alberto
Asked On December 10, 2019 12:37 AM UTC

I've been trying to set the property `DropDownItemFontFamily` in the SfAutoComplete in my `App.xaml`.
But it seems to not get it. No matter if I set it as a `StaticResource` or a `DynamicResource`.

Code:
App.xaml:
```
<Application.Resources>
        <ResourceDictionary>
<OnPlatform x:Key="MontserratBoldItalic" x:TypeArguments="x:String">
                <On Platform="iOS" Value="Montserrat-BoldItalic" />
                <On Platform="Android" Value="Montserrat-BoldItalic.otf#Bold Italic" />
            </OnPlatform>
        </ResourceDictionary>

<Style ApplyToDerivedTypes="True" TargetType="{x:Type sfAutoComplete:SfAutoComplete}">
            <Setter Property="DropDownBackgroundColor" Value="{StaticResource PrimaryColor}" />
            <Setter Property="DropDownBorderColor" Value="{StaticResource ButtonBorderColor}" />
            <Setter Property="DropDownTextColor" Value="White" />
            <Setter Property="DropDownItemFontFamily" Value="{DynamicResource MontserratBoldItalic}" />
            <Setter Property="ShowSuggestionsOnFocus" Value="True" />
            <Setter Property="SuggestionBoxPlacement" Value="Bottom" />
            <Setter Property="SuggestionMode" Value="StartsWith" />
            <Setter Property="TextColor" Value="White" />
            <Setter Property="FontFamily" Value="{DynamicResource MontserratBoldItalic}" />
        </Style>
...
    </Application.Resources>
```
Not even setting in the the view seems to do it.
```
<sfAutoComplete:SfAutoComplete
                    x:Name="autoCompleteType"
                    DataSource="{Binding CategoriesList}"
                    DropDownItemFontFamily="{StaticResource MontserratBoldItalic}"
                    Text="{Binding Type}"
                    ValueChanged="Handle_ValueChanged" />
```

What am i doing wrong?

Hemalatha Marikumar [Syncfusion]
Replied On December 10, 2019 08:44 AM UTC

Hi Alberto, 
  
Greeting from Syncfusion. 
  
We have validated your query and prepared a sample based on requirement using Montserrat-BoldItalic.otf . We were unable to reproduce the reported issue. Please find the tested sample from link below. 
  
  
Code Snippet [XAML] : App.XAML 
 
<Application.Resources> 
        <ResourceDictionary> 
            <OnPlatform x:TypeArguments="x:String" 
                        x:Key="customfontfamily" 
                        iOS="Montserrat-BoldItalic" 
                        Android="Montserrat-BoldItalic.otf" 
                        WinPhone="Assets/Montserrat-BoldItalic.otf#Montserrat" /> 
        </ResourceDictionary> 
    </Application.Resources> 
 
 
 Code Snippet [XAML] : MainPage.XAML 
 
<autocomplete:SfAutoComplete x:Name="autoComplete" 
                                     SuggestionMode="Contains" 
                                     FontFamily="{StaticResource customfontfamily}" 
                                     DropDownItemFontFamily="{StaticResource customfontfamily}" 
                                     DataSource="{Binding ItemsCollection}" 
                                     /> 
 
 
 
 
Note: 
  
Please ensure whether the font files are included in the Info.plist file (fonts that are provided by application, UIAppFonts, or key) in iOS platform. 
   
Please check above sample and ensure whether the reported issue has been occurred or not. If still occurs with provided sample, please update us by modifying the sample to replicate the issue which will more helpful for us to analyze further and provide a better solution. 
 
Regards, 
Hemalatha M. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon