MonthViewSettings for SelectedDayTextColor and TodayTextColor not working on iOS

Hi,

I have customized MonthViewSettings, but the SelectedDayTextColor and TodayTextColor not working well on iOS. If current date is today date, the SelectedDate on iOS don't get the configured style and after 2 or 3 clicks the TodayTextColor style appears.

This is the XAML for MonthViewSettings:

<cal:MonthViewSettings DayHeaderBackgroundColor="Blue" 
                                 DayHeaderTextColor="White"
                                 HeaderTextColor="White"
                                 HeaderBackgroundColor="
Blue"
                                 CurrentMonthBackgroundColor="
Blue"
                                 CurrentMonthTextColor="White"
                                 PreviousMonthBackgroundColor="
Blue"
                                 PreviousMonthTextColor="White"
                                 DateSelectionColor="White"
                                 SelectedDayTextColor="
Blue"
                                 TodayTextColor="
Blue">

On code behind I have this code when selection changed:

void MonthViewCalendar_SelectionChanged(object sender, SelectionChangedEventArgs args)
    {
      monthViewCalendar.MonthViewSettings.TodayTextColor =
        monthViewCalendar.SelectedDate.Date.CompareTo(DateTime.Now.Date) == 0 ?
        Color.Blue : Color.White;
    }


The images result for iOS and Android are attached.

Thanks.

 

Attachment: Calendar_7ed0e0e1.zip

3 Replies

RG Rajkumar Ganesamoorthy Syncfusion Team October 18, 2017 12:42 PM UTC

Hi David,

Thanks for contacting Syncfusion Support.

We have prepared a sample to meet your reported requirement based on your provided screenshot. Please find the sample from below

Regards,
Rajkumar G



AB Ashwini Bokade February 18, 2020 06:48 AM UTC

<syncfusion:SfCalendar x:Name="calendar" SelectionMode="MultiRangeSelection" Unfocused="calendar_Unfocused" ViewMode="MonthView"
                                               SelectionChanged="calendar_SelectionChanged" ShowLeadingAndTrailingDays="True" BackgroundColor="#F6f6f6"> 
                            <syncfusion:SfCalendar.HeaderView>
                                <Grid HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" ColumnSpacing="0" BackgroundColor="#F6f6f6">
                                    <Grid.GestureRecognizers>
                                        <TapGestureRecognizer Tapped="ShowYearView_Tapped"/>
                                    </Grid.GestureRecognizers>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>

                                    <!--Left Arrow-->
                                    <Grid Grid.Column="0" HorizontalOptions="EndAndExpand" VerticalOptions="FillAndExpand" HeightRequest="35" WidthRequest="35">
                                        <Grid.GestureRecognizers>
                                            <TapGestureRecognizer Tapped="DecreaseMonth_Tapped"/>
                                        </Grid.GestureRecognizers>
                                        <Image Source="left.png" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"/>
                                    </Grid>
                                  
                                    <!--Month and Year Name-->
                                    <Label Grid.Column="1" Text="{Binding CalendarDate}" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" FontSize="18"
                                           FontFamily="{StaticResource PoppinsSemiBold}" TextColor="{StaticResource AppTextBlackColor}" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"   />

                                    <Grid Grid.Column="2" HorizontalOptions="StartAndExpand" VerticalOptions="FillAndExpand" HeightRequest="35" WidthRequest="35">
                                        <Grid.GestureRecognizers>
                                            <TapGestureRecognizer Tapped="IncreaseMonth_Tapped"/>
                                        </Grid.GestureRecognizers>
                                        <Image Source="rightCal.png" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"/>
                                    </Grid>
                                </Grid>
                            </syncfusion:SfCalendar.HeaderView>
                            <syncfusion:SfCalendar.MonthViewSettings>
                                <syncfusion:MonthViewSettings CurrentMonthBackgroundColor="#800080" CurrentMonthTextColor="#ffffff" PreviousMonthBackgroundColor="#9895F0"
                                    PreviousMonthTextColor="#000000" DateSelectionColor="Yellow" SelectedDayTextColor="Red" DayHeaderFormat="EEEEE" DayFontSize="12"
                                    DayHeaderFontSize="14" DayHeaderBackgroundColor="#F6F6F6" SelectionRadius="15" TodaySelectionTextColor="Black" TodaySelectionBackgroundColor="Green"
                                    DayHeaderTextColor="Black" HeaderBackgroundColor="Pink" HeaderFontAttributes="Italic" HeaderFontSize="16" WeekEndTextColor="#fe4a49"
                                    WeekEndBackgroundColor="#2ab7ca" CellGridOptions="None">
                                    <syncfusion:MonthViewSettings.HeaderFontFamily>
                                        <OnPlatform x:TypeArguments="x:String" iOS="Poppins-Regular" Android="Poppins-Regular.ttf" WinPhone="Assets/Poppins-Regular.ttf#Poppins" />
                                    </syncfusion:MonthViewSettings.HeaderFontFamily>
                                    <syncfusion:MonthViewSettings.DayHeaderFontFamily>
                                        <OnPlatform x:TypeArguments="x:String" iOS="Poppins-Regular" Android="Poppins-Regular.ttf" WinPhone="Assets/Poppins-Regular.ttf#Poppins" />
                                    </syncfusion:MonthViewSettings.DayHeaderFontFamily>
                                    <syncfusion:MonthViewSettings.DayCellFontFamily>
                                        <OnPlatform x:TypeArguments="x:String" iOS="Poppins-Regular" Android="Poppins-Regular.ttf" WinPhone="Assets/Poppins-Regular.ttf#Poppins" />
                                    </syncfusion:MonthViewSettings.DayCellFontFamily> 
                                </syncfusion:MonthViewSettings>
                            </syncfusion:SfCalendar.MonthViewSettings>
                        </syncfusion:SfCalendar>

MonthView setting is not at all changing a single color. I have tried a lot. but none of the colors work.Please help

Attachment: screen_994b18af.zip


SS SaiGanesh Sakthivel Syncfusion Team February 19, 2020 03:49 PM UTC

Hi Ashwini, 
Thank you for using Syncfusion products. 
We have checked the reported query “” from our end. We would like to let you know that we could not able to reproduce the issue. Based on the information provided, we have prepared sample and attached in the following link, 
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/MonthViewIssue-155850439 
Please check the sample and let us know if you still facing the same issue. If not, please modify the sample and revert us back with the following details, 
  • Device configuration details
  • Stack trace of the reported crash
  • Issue reporting video (if possible)
  • Syncfusion and Xamarin Forms updated version
It will be helpful for us to check on it and provide you the solution at the earliest. 
Regards, 
SaiGanesh Sakthivel 



Loader.
Up arrow icon