当前位置: 首页>>代码示例>>C#>>正文


C# UIDatePicker.SetValueForKey方法代码示例

本文整理汇总了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 );
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:67,代码来源:ProfileViewController.cs


注:本文中的UIDatePicker.SetValueForKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。