コード例 #1
0
        private void EditNumberPicker()
        {
            if (this._pickerView == null)
            {
                this._pickerView = new AspyPickerView
                                   (
                    new CGRect(
                        this._pickerTxtField.Frame.X,
                        this._pickerTxtField.Frame.Y - this._fPickerYOffset,
                        this._pickerTxtField.Frame.Width,
                        this._pickerTxtField.Frame.Height * 5.0f)

                                   );
                this.View.AddSubview(this._pickerView);
                this.View.BringSubviewToFront(this._pickerView);
                //this.AlternateParentViewController.View.AddSubview (this._pickerView);
            }

            this._pickerView.UserInteractionEnabled = true;
            this._pickerView.ShowSelectionIndicator = true;
            this._pickerView.Model          = this._pickerModel;
            this._pickerModel.SelectedIndex = this.GetSelectedItem(this._strPickerText);
            this._pickerView.Select(this._pickerModel.SelectedIndex, 0, false);
            this.AlternateParentViewController.View.BringSubviewToFront(this._pickerView);
            // Wire up tapgesture to
            this.pkSingleTapGestureRecognizer();
        }
コード例 #2
0
 protected void CloseNumberPicker()
 {
     this._pickerView.RemoveGestureRecognizer(singleTapGesture);
     this.singleTapGesture     = null;
     this._pickerView.Delegate = null;
     this._pickerView.RemoveFromSuperview();
     this._pickerView = null;
 }