Category / Section
How to show Calendar using SfPopupLayout in Xamarin.iOS (SfCalendar) ?
1 min read
You can show the SfCalendar using SfPopupLayout in Xamarin.Forms.
C#
Set HeaderHeight property of calendar as Zero to hide the default header.
//// Initialize SfCalendar calendar = new SFCalendar(); calendar.MonthChanged += Calendar_MonthChanged; calendar.HeaderHeight = 0; calendar.MonthViewSettings.TodaySelectionBackgroundColor = UIColor.FromRGB(137, 82, 83);
C#
Initialize the PopupLayout and set the custom header content as the SfPopupLayout HeaderView.
//// Initialize SfPopUpLayout popupLayout = new SfPopupLayout(); headerContent = new UILabel(); headerContent.TextAlignment = UITextAlignment.Center; headerContent.BackgroundColor = UIColor.FromRGB(137, 82, 83); headerContent.TextColor = UIColor.White; headerContent.Font = UIFont.FromName("Helvetica-Bold", 16); // Adding Header view of the SfPopupLayout popupLayout.PopupView.HeaderView = headerContent; popupLayout.PopupView.ShowCloseButton = false;
C#
Set Sfcalendar as ContentView of SfPopupLayout.
// Adding Calendar as ContentView of the SfPopupLayout popupLayout.PopupView.ContentView = calendar;
Output