【发布时间】:2011-06-18 07:32:39
【问题描述】:
当我创建一个新的 UIDatePicker 并将其 Mode 设置为 CountDownTimer 时,它在黑色背景下呈现不佳。任何人有任何见解?
普通选择器如下所示:
代码:注意 UIButton 是选择器后面的全屏按钮,用于关闭视图
intervalPicker = new UIDatePicker(new RectangleF(0, this.tvc.View.Bounds.Height - 135, this.tvc.View.Bounds.Width, 200));
intervalPicker.Mode = UIDatePickerMode.CountDownTimer;
intervalPicker.CountDownDuration = DeviceSession.CurrentBehavioralEvent.Duration*60;
intervalPicker.ValueChanged += new EventHandler(intervalPicker_EditingChanged);
UIButton b = UIButton.FromType(UIButtonType.Custom);
b.Opaque = false;
b.BackgroundColor = UIColor.Clear;
b.Frame = new RectangleF(0, 0, this.tvc.View.Bounds.Width, this.tvc.View.Bounds.Height);
b.TouchUpInside += (o, s) => {
intervalPicker.RemoveFromSuperview();
b.RemoveFromSuperview();
};
this.tvc.NavigationController.View.AddSubview(b);
this.tvc.NavigationController.View.AddSubview(intervalPicker);
【问题讨论】:
-
上面的代码我已经贴出来了。
标签: ipad ios rendering xamarin.ios uidatepicker