在 iOS 故事板视图中使用模糊背景 [英] Using blurred background in view with the storyboard in iOS

查看:29
本文介绍了在 iOS 故事板视图中使用模糊背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(我在 iOS 8 上使用 Swift)

(I am using Swift with iOS 8)

我正在向 UiViewController 添加(子)视图.这个子视图应该包含一些包含一些信息的 UiLabels.我希望子视图的背景像 iOS 的通知中心一样模糊.

I am adding a (Sub)View to a UiViewController. This subview should hold a few UiLabels with some information in it. I want the subview to have a blurred background like the notification center of iOS has.

我知道使用 UIEffectView 可以做到这一点,但是如何使用故事板分配这种模糊效果?我实际上不想以编程方式创建我的视图.

I know this is possible using UIEffectView, but how could I assign such a blurred effect using the storyboard? I actually don't want to create my views programmatically.

谢谢

推荐答案

是的,这在 Xcode 6 中是可能的.只需在对象库中搜索Visual Effect View with Blur"(右下角).这些可以像任何其他视图一样添加到您的视图控制器中.您还可以在属性检查器中更改模糊样式(亮、暗、额外亮).

Yes this is possible in Xcode 6. Just search for "Visual Effect View with Blur" in the object library (bottom right). These can be added to your view controllers like any other view. You can also change the blur style in the attributes inspector (light, dark, extra light).

希望这会有所帮助.

这篇关于在 iOS 故事板视图中使用模糊背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆