本文整理汇总了C#中UIDatePicker.SetValueForKey方法的典型用法代码示例。如果您正苦于以下问题:C# UIDatePicker.SetValueForKey方法的具体用法?C# UIDatePicker.SetValueForKey怎么用?C# UIDatePicker.SetValueForKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIDatePicker
的用法示例。
在下文中一共展示了UIDatePicker.SetValueForKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidLoad
//.........这里部分代码省略.........
PresentViewController( actionSheet, true, null );
};
DoneButton = new UIButton( );
ScrollView.AddSubview( DoneButton );
ControlStyling.StyleButton( DoneButton, ProfileStrings.DoneButtonTitle, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize );
DoneButton.SizeToFit( );
LogoutButton = new UIButton( );
ScrollView.AddSubview( LogoutButton );
LogoutButton.SetTitleColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ), UIControlState.Normal );
LogoutButton.SetTitle( ProfileStrings.LogoutButtonTitle, UIControlState.Normal );
LogoutButton.SizeToFit( );
// setup the pickers
UILabel genderPickerLabel = new UILabel( );
ControlStyling.StyleUILabel( genderPickerLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize );
genderPickerLabel.Text = ProfileStrings.SelectGenderLabel;
GenderPicker = new PickerAdjustManager( View, ScrollView, genderPickerLabel, Gender.Background );
UIPickerView genderPicker = new UIPickerView();
genderPicker.Model = new GenderPickerModel() { Parent = this };
GenderPicker.SetPicker( genderPicker );
UILabel birthdatePickerLabel = new UILabel( );
ControlStyling.StyleUILabel( birthdatePickerLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize );
birthdatePickerLabel.Text = ProfileStrings.SelectBirthdateLabel;
BirthdatePicker = new PickerAdjustManager( View, ScrollView, birthdatePickerLabel, Birthdate.Background );
UIDatePicker datePicker = new UIDatePicker();
datePicker.SetValueForKey( UIColor.White, new NSString( "textColor" ) );
datePicker.Mode = UIDatePickerMode.Date;
datePicker.MinimumDate = new DateTime( 1900, 1, 1 ).DateTimeToNSDate( );
datePicker.MaximumDate = DateTime.Now.DateTimeToNSDate( );
datePicker.ValueChanged += (object sender, EventArgs e ) =>
{
NSDate pickerDate = ((UIDatePicker) sender).Date;
Birthdate.Field.Text = string.Format( "{0:MMMMM dd yyyy}", pickerDate.NSDateToDateTime( ) );
};
BirthdatePicker.SetPicker( datePicker );
// Allow the return on username and password to start
// the login process
NickName.Field.ShouldReturn += TextFieldShouldReturn;
LastName.Field.ShouldReturn += TextFieldShouldReturn;
Email.Field.ShouldReturn += TextFieldShouldReturn;
// If submit is pressed with dirty changes, prompt the user to save them.
DoneButton.TouchUpInside += (object sender, EventArgs e) =>
{
if( GenderPicker.Revealed == false && BirthdatePicker.Revealed == false)
{
if( Dirty == true )
{
// make sure the input is valid before asking them what they want to do.
if ( ValidateInput( ) )
{
// if there were changes, create an action sheet for them to confirm.
UIAlertController actionSheet = UIAlertController.Create( ProfileStrings.SubmitChangesTitle,
null,
UIAlertControllerStyle.ActionSheet );