IOS:UIDatePicker渲染效果不佳,背景为黑色

Chr*_*ken 5 rendering uidatepicker xamarin.ios ipad ios

当我创建一个新的UIDatePicker,其Mode设置为CountDownTimer时,它呈现黑色背景很差.有人有任何见解吗? 在此输入图像描述

Normal Picker看起来像这样:

在此输入图像描述

代码:请注意,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);
Run Code Online (Sandbox Code Playgroud)

小智 6

当您将帧高度设置为小于216时,CountDownTimer模式下的UIDatePicker以这种方式显示.其他模式没有此问题.

您的示例是将高度设置为200.

将高度更改为216.