xamarin RadListPicker Text color can't change

1 Answer 150 Views
ListView ListView - Xamarin.Android
Chiran
Top achievements
Rank 1
Iron
Iron
Chiran asked on 09 Jul 2021, 11:43 AM | edited on 09 Jul 2021, 12:33 PM

Hi,

I'm trying to change the text color & size of RadListPicker popup,

ItemStyle="{StaticResource ItemStyle}"

 <Style TargetType="telerikDataControls:SpinnerItemView" x:Key="ItemStyle">
            <Setter Property="BackgroundColor" Value="#2a3137"/>
            <Setter Property="TextColor" Value="#f00" />
            <Setter Property="FontSize" Value="14"/>
</Style>

these highlighted values are not applying to the view, but BackgroundColor applying...

Please give me a solution to this issue.

Thanks

         

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 12 Jul 2021, 08:16 AM

Hello Chiran,

I have checked the example here and the TextColor and FontSize are applied as expected:  https://docs.telerik.com/devtools/xamarin/controls/listpicker/list-picker-styling#item-style 

Here is my XAML:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
             xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
             xmlns:telerikDataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"
             x:Class="TestSFAX.MainPage">
    <ContentPage.Resources>
        <ResourceDictionary>
            <Style TargetType="telerikDataControls:SpinnerItemView" x:Key="SelectedItemStyle">
                <Setter Property="BackgroundColor" Value="#F0F0F0"/>
                <Setter Property="CornerRadius" Value="0"/>
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="TextColor" Value="Aqua" />
                <Setter Property="FontSize" Value="20"/>
            </Style>

            <Style TargetType="telerikDataControls:SpinnerItemView" x:Key="ItemStyle">
                <Setter Property="BackgroundColor" Value="#F8F8F8"/>
                <Setter Property="CornerRadius" Value="0"/>
                <Setter Property="TextColor" Value="Red" />
                <Setter Property="FontSize" Value="12"/>
            </Style>
        </ResourceDictionary>
    </ContentPage.Resources>
    <StackLayout>
        <telerikInput:RadListPicker Placeholder="Pick a City Name!"
                            ItemsSource="{Binding Items}" 
                            DisplayMemberPath="Name"
                            IsLooping="True"
                            DisplayStringFormat="You have picked: {0}"
                            ItemStyle="{StaticResource ItemStyle}"
                            SelectedItemStyle="{StaticResource SelectedItemStyle}">
        </telerikInput:RadListPicker>
    </StackLayout>
</ContentPage>

and the result: 

Send me the exact steps to reproduce the issue and on which platform/version the behavior occurs.

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Chiran
Top achievements
Rank 1
Iron
Iron
commented on 14 Jul 2021, 10:58 AM

Hi Didi,
Thanks for the help It works...
Tags
ListView ListView - Xamarin.Android
Asked by
Chiran
Top achievements
Rank 1
Iron
Iron
Answers by
Didi
Telerik team
Share this question
or