2016-04-09 22 views
0

Xamarin Studio'daki XLabs Nuget paketinden Xamarin Formlar'daki CalendarView denetimini kullanıyorum.Xamarin XLabs Formlar CalendarView Android üzerinde çalışmıyor

CalendarView aşağıda olarak tanımlanır, ancak hiçbir Takvim android cihazda gösterilmiştir:

using System; 

using Xamarin.Forms; 
using XLabs.Forms.Controls; 

namespace CustomRenderer 
{ 
public class MyPage : ContentPage 
{ 
    public MyPage() 
    { 
     CalendarView calendarView = new XLabs.Forms.Controls.CalendarView 
      { 
       MinDate = new DateTime(2016, 1,1), 
       MaxDate = new DateTime(2016, 1, 31), 
       VerticalOptions = LayoutOptions.FillAndExpand, 
       HorizontalOptions = LayoutOptions.FillAndExpand, 
       ShowNavigationArrows = true, 

       DateBackgroundColor = Color.White, 
       IsVisible = true, 
      }; 

     calendarView.DateSelected += (object sender, DateTime e) => { 

     }; 
     Content = new StackLayout 
     { 

       HeightRequest = 400, 
       WidthRequest = 320, 
      Children = 
      { 
       calendarView 
      } 
     }; 
    } 
} 
} 

cevap

0

MainActivity : XFormsApplicationDroid 

ile MainActivity başlatmak VE yanı Droid projeye XLabs eklemeyi unutmayın . Şuan çalışıyor.

0

kodunun altına kullanın, İşe yarayacak

var MinDt = new DateTime(1970, 1, 1); 
         var MaxDt = new DateTime(2070,1,1); 
         Pages.Add(id, new CarlNavPage(new ContentPage 
         { 

          Content = new CalendarView() { 
           MinDate = CalendarView.FirstDayOfMonth(MinDt), 
           MaxDate = CalendarView.LastDayOfMonth(MaxDt), 
           HighlightedDateBackgroundColor = Color.FromRgb(227, 227, 227), 
           MonthTitleBackgroundColor = Color.FromHex("#f1eff5"), 
           ShouldHighlightDaysOfWeekLabels = false, 
           SelectionBackgroundStyle = CalendarView.BackgroundStyle.Fill, 
           TodayBackgroundStyle = CalendarView.BackgroundStyle.CircleOutline, 
           BackgroundColor = Color.FromHex("#f1eff5"), 
           HighlightedDateForegroundColor = Color.FromHex("#f1eff5"), 
           // HighlightedDaysOfWeek = new DayOfWeek[] { DayOfWeek.Saturday, DayOfWeek.Sunday }, 
           ShowNavigationArrows = true, 
          }, 
         })); 
İlgili konular