コード例 #1
0
            public ChoiceField(RectangleF frame, ShareViewController controller, string title)
                : base(frame, controller, title)
            {
                ValueLabel = new LabelButton()
                {
                    BackgroundColor  = UIColor.Clear,
                    Font             = TextEditorFont,
                    TextColor        = UIColor.DarkTextColor,
                    TextAlignment    = UITextAlignment.Right,
                    AutoresizingMask = UIViewAutoresizing.FlexibleWidth,
                };
                var tf = TitleLabel.Frame;

                                #if !__UNIFIED__
                ValueLabel.Frame = new RectangleF(tf.Right, 0, frame.Width - tf.Right, frame.Height - 1);
                                #else
                // ValueLabel.Frame = new RectangleF ((float)tf.Right, 0, (float)((nfloat)frame.Width - tf.Right), (float)(frame.Height - 1));
                ValueLabel.Frame = new RectangleF(0, 0, (float)((nfloat)frame.Width - tf.Left), (float)(frame.Height - 1));
                                #endif
                ValueLabel.TouchUpInside += HandleTouchUpInside;

                AddSubview(ValueLabel);

                Picker        = new CheckedPickerView(new RectangleF(0, 0, 320, 216));
                Picker.Hidden = true;
                Picker.SelectedItemChanged += delegate {
                    ValueLabel.Text = Picker.SelectedItem;
                };
                controller.View.AddSubview(Picker);

                ValueLabel.Text = Picker.SelectedItem;
            }
コード例 #2
0
			public ChoiceField (RectangleF frame, ShareViewController controller, string title)
				: base (frame, controller, title)
			{
				ValueLabel = new LabelButton () {
					BackgroundColor = UIColor.White,
					Font = TextEditorFont,
					TextColor = UIColor.DarkTextColor,
					AutoresizingMask = UIViewAutoresizing.FlexibleWidth,
				};				
				var tf = TitleLabel.Frame;
				ValueLabel.Frame = new RectangleF (tf.Right, 0, frame.Width - tf.Right, frame.Height - 1);

				ValueLabel.TouchUpInside += HandleTouchUpInside;

				AddSubview (ValueLabel);

				Picker = new CheckedPickerView (new RectangleF (0, 0, 320, 216));
				Picker.Hidden = true;
				Picker.SelectedItemChanged += delegate {
					ValueLabel.Text = Picker.SelectedItem;
				};
				controller.View.AddSubview (Picker);

				ValueLabel.Text = Picker.SelectedItem;
			}