2016-09-27 10 views
0

私はXamarin.Forms developerの初心者です。Application私はcalendarを表示しています。この目的のために、私はこのアプリケーションのためにこのhttps://github.com/rebeccaXam/XamForms.Controls.Calendarプラグインを使用しました。このプラグイン(カスタムカレンダー)は、小さなUI issueを除いて問題なく動作しています。カレンダーを表示しているときは、最初にの2013年10月ののデフォルト値がロードされ、カレンダーに現在のMonthが表示されます。問題を解決するのを手伝ってください。Xamarin.FormsのXamForms.Controls.Calendarは、当初10月に表示されました

DateSelection.xaml

<?xml version="1.0" encoding="UTF-8"?> 
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="TestApp.DateSelection" 
     xmlns:i18n="clr-namespace:CareValet;assembly=CareValet" 
     xmlns:controls="clr-namespace:XamForms.Controls;assembly=XamForms.Controls.Calendar"   
     Title="Date Selection"> 
    <ContentPage.Padding> 
     <OnPlatform x:TypeArguments="Thickness" 
         iOS="20, 40, 20, 20" 
         Android="20, 20, 20, 20" 
         WinPhone="20, 20, 20, 20" /> 
     </ContentPage.Padding> 
    <ContentPage.Content> 
     <ScrollView> 
      <RelativeLayout> 

      //.....My Code.... 
        <controls:Calendar x:Name="calender" Padding="10,0,10,0" StartDay="Sunday" DateClicked="DateClicked" 
         RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width,Factor=1,Constant=0}" 
         RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0,Constant=200}" 
         RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=selectDateText, Property=Y, Factor=1, Constant=25}" 
        RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width, Factor=0}"></controls:Calendar> 

      //.....My Code.... 
       </RelativeLayout> 
      </ScrollView> 
    </ContentPage.Content> 
</ContentPage> 

DateSelection.cs

namespace TestApp 
{ 
    public partial class DateSelection : ContentPage 
    { 

     public DateSelection() 
     { 
      InitializeComponent(); 

     } 


     // Selecting Date 
     void DateClicked(object sender, EventArgs e) 
     { 

     /* 

     Doing some operation while date selection 
     */ 


     } 


    } 
} 

答えて

0

それはOctober 2013 is hardcodedのように見えます。しかし、あなたが好きなものにStartDateプロパティを設定すると、それは表示された日付になります。

+0

私のプロジェクトでハードコードされたテキスト "OCTOBER 2013"を削除することは可能ですか? – Jamal

+0

'TitleLabel'プロパティを設定してください。ステファンは' StartDate'プロパティを設定しました。 –

+0

'StartDate'プロパティを設定したときにラベルが更新されるコードを最後のコメントでスクラッチします。 –

関連する問題