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

ipad – IOS:UIDatePicker渲染效果不佳,背景为黑色,第1张

概述当我创建一个新的UIDatePicker,其Mode设置为CountDownTimer时,它呈现黑色背景很差.有人有任何见解吗? Normal Picker看起来像这样: 代码:请注意,UIButton是拾取器后面的全屏按钮,用于关闭视图 intervalPicker = new UIDatePicker(new RectangleF(0, this.tvc.View.Bounds.Height 当我创建一个新的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,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);
解决方法 当您将帧高度设置为小于216时,CountDownTimer模式下的UIDatePicker以这种方式显示.其他模式没有此问题.

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

将高度更改为216.

总结

以上是内存溢出为你收集整理的ipad – IOS:UIDatePicker渲染效果不佳,背景为黑色全部内容,希望文章能够帮你解决ipad – IOS:UIDatePicker渲染效果不佳,背景为黑色所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1080630.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存