如何使UIPopoverPresentationController对iOS 9半透明

如何使UIPopoverPresentationController对iOS 9半透明,第1张

概述我使用IB来创建一个segue来呈现另一个视图popover. 我在prepareForSegue中添加了一个代码,用于将UIPopoverPresentationControllerDelegate释放到初始控制器. 我设置了演示风格: func adaptivePresentationStyleForPresentationController(controller: UIPresentati 我使用IB来创建一个segue来呈现另一个视图popover.

我在prepareForSegue中添加了一个代码,用于将UIPopoverPresentationControllerDelegate释放到初始控制器.

我设置了演示风格:

func adaptivePresentationStyleForPresentationController(controller: UIPresentationController,traitCollection: uitraitcollection) -> UIModalPresentationStyle {      return UIModalPresentationStyle.None}

这给了我一个很好的标准d出窗口.

但是,我想制作一个半透明的popover.

我尝试了几件事:

>我将IB中的背景颜色设置为“清除”
>我试图在d出窗口视图上设置Alpha

解决方法 要使视图控制器具有透明度,您需要返回UIModalPresentationStyle.OverCurrentContext. 总结

以上是内存溢出为你收集整理的如何使UIPopoverPresentationController对iOS 9半透明全部内容,希望文章能够帮你解决如何使UIPopoverPresentationController对iOS 9半透明所遇到的程序开发问题。

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

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

原文地址: http://outofmemory.cn/web/1058829.html

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

发表评论

登录后才能评论

评论列表(0条)

保存