Hello, I have recently implemented the Alliance Calendar to see how well it works, on functionality is indeed great, but I have been unable to change the background of the individual cells for the days, I hope someone might have an idea to share.
The documentation (https:components.xamarin.com/gettingstarted/alliance-calendar-component) says the next:
Set Calendar Cell Styles: CalendarControl.CalendarDaysStyleId = Resource.Style.calendar_today; CalendarControl.WeekendDaysStyleId = Resource.Style.calendar_day; CalendarControl.WeekendDaysBackgroundStyleId = Resource.Drawable.myBackground;
The rest of the code works great, but these 3 lines of code do not seem to work for me, the Style only changes the text color, and the drawable for the background is no where to be seen.
this is the style I am using: #fff000 center bold #000000 1 1 2 @drawable/calendar_week_backgroud
<style name="calendar_day" >
<item name="android:textColor" >#000fff</item>
<item name="android:gravity" >center</item>
<item name="android:textStyle" >bold</item>
<item name="android:shadowColor" >#fff000</item>
<item name="android:shadowDx" >1</item>
<item name="android:shadowDy" >1</item>
<item name="android:shadowRadius" >2</item>
<item name="android:background">@drawable/calendar_week_backgroud</item>
</style>
I have attached an image of the calendar, what I want to achieve is to change the blue color to white, the selected day to green instead of blue and all the other cells to white, this is my code so far:
calendar = FindViewById (Resource.Id.CalendarControl1); string[] customNames = { "sun", "mon", "tue", "wed", "thu", "fry", "sat" }; calendar.NextButtonStyleId = Resource.Drawable.calendar_long_next; calendar.NextButtonText = "Next"; calendar.PreviousButtonStyleId = Resource.Drawable.calendar_long_prev; calendar.PreviousButtonText = "Prev"; calendar.Background = Resources.GetDrawable (Resource.Drawable.calendar_month_background); calendar.SetCustomWeekNames (customNames);
//these lines, I believe, are the problem calendar.CalendarDaysStyleId = Resource.Style.calendar_day; calendar.WeekendDaysStyleId = Resource.Style.calendar_today; calendar.WeekendDaysBackgroundStyleId = Resource.Drawable.calendar_week_backgroud;
I have only been able to change the general background to green and the text color to blue, thanks in advance.