gpt4 book ai didi

ipad - IOS:UIDatePicker 呈现黑色背景效果不佳

转载 作者:可可西里 更新时间:2023-11-01 04:36:58 27 4
gpt4 key购买 nike

当我创建一个模式设置为 CountDownTimer 的新 UIDatePicker 时,它呈现黑色背景时效果很差。任何人有任何见解? enter image description here

普通选择器看起来像这样:

enter image description here

代码:注意 UIButton 是选择器后面的一个全屏按钮,用于关闭 View

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);

最佳答案

CountDownTimer模式下的UIDatePicker在设置帧高小于216时会这样显示,其他模式没有这个问题。

您的示例将高度设置为 200。

将高度更改为 216。

关于ipad - IOS:UIDatePicker 呈现黑色背景效果不佳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4846657/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com