2017-06-30 32 views
1

有沒有辦法在UIViewController中使用ContentPage如何使用ContentPage與UIViewController - VisualStudio IOS

我正在使用繼承View的SyncFusion SfCalendar,我想在我的視圖控制器中顯示callendar。

SfCalendar _calendar; 
    public CalendarTest(IntPtr handle) : base(handle) 
    { 
    } 

    public override void ViewDidLoad() 
    { 
     _calendar = new SfCalendar(); 
     _calendar.OnDateCellHolding += DateCellClicked; 

     base.ViewDidLoad(); 
    } 

回答

1

我附上了代碼示例,它將SFCalendar添加到ViewController視圖。

public override void ViewDidLoad() 
    { 
     SFCalendar calendar = new SFCalendar(); 
     base.ViewDidLoad(); 
     calendar.Frame = new CGRect(0, 0, View.Frame.Width, View.Frame.Height); 
     SFMonthViewSettings month = new SFMonthViewSettings(); 
     month.BorderColor = UIColor.Red; 
     calendar.MonthViewSettings = month; 
     View.AddSubview(calendar); 

    } 
相關問題