当一个视图显示的iOS暗淡的背景 [英] iOS Dim background when a view is shown

查看:115
本文介绍了当一个视图显示的iOS暗淡的背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的主要看法,我做了一些手势动作导致一些新的视图中显示。在这个时候,我希望可以调暗整个背景(除新观点)是一个不错的用户界面的做法。在HTML中,使用Javascript它看起来像这样 - ?如何在iOS同样的效果。

In my main view, I do some gesture action causing some new view to be shown. At this time I want to dim the entire background (except this new view) as a good UI practice. In HTML, Javascript it looks like so - How do I get this same effect in iOS ?

推荐答案

莱在后台一个UIView,设置它的背景 [的UIColor blackColor] 和其不透明度设置为像0.6。然后将模态视图添加到父视图。

Lay a UIView over the background, set its background to [UIColor blackColor] and set its opacity to like 0.6. Then add the modal view to the parent view.

这会黯淡了背景和拦截任何水龙头后台控制。

This'll dim out the background AND intercept any taps to background controls.

这篇关于当一个视图显示的iOS暗淡的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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