Hi All,
I have a custom view for appointment that consists of StackLayout, Image, and Label inside OnAppointmentLoadedEvent.
This is my code:
ScheduleWeekView.OnAppointmentLoadedEvent += (sender, e) =>
{
var layout = new StackLayout
{
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Orientation = StackOrientation.Horizontal,
Margin = new Thickness(0),
Padding = new Thickness(0),
Spacing = 0
};
var _event = e.appointment as Events;
if (_event != null)
{
if (_event.Priority == EventsPriority.HIGH)
{
var image = new Image
{
VerticalOptions = LayoutOptions.CenterAndExpand,
Source = "Icons/ic_high_priority.png"
};
layout.Children.Add(image);
}
var label = new Label
{
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand,
TextColor = Color.White,
Text = _event.Subject
};
layout.BackgroundColor = _event.Color;
layout.Children.Add(label);
}
e.view = layout;
};
The problem is when build between Android and iOS there’s a difference. In Android, custom view appear while in iOS not appear, as the attached picture.
When using custom view in iOS, CellTapped always returns null appointment
ScheduleWeekView.CellTapped += (sender, e) =>
{
if (e.Appointment != null)
{
var _event = (Events)e.Appointment;
Navigation.PushAsync(new CalendarEventsPage(category: _event.Category, events: _event), true);
}
} ;
Any ideas?
Thanks..