当另一个视图显示时,如何使我的背景视图变暗? [英] How to make my background view to be dark when the another view is showing?
本文介绍了当另一个视图显示时,如何使我的背景视图变暗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个iPhone应用程序,在其中单击一个按钮,我正在显示一个类似于alertview的视图.那时我希望剩余的视图(背景)成为一个阴影,就像我们在显示alertview时看到的背景一样有人可以帮助我实现这一目标吗?
I have an iphone application in which in a button click i am showing a view like an alertview.at that time i want my remaining views (background) to be a shadow one,like as we see the background when showing the alertview.Can anybody help me to achieve this?
推荐答案
这很简单,使新视图成为视图的子视图,该视图覆盖全屏(alpha设置为0.7或您选择的颜色),然后呈现此视图,则后面的所有内容都应变暗.
This is rather simple, make your new view a sub view of a view that covers the full screen with alpha set to 0.7 or something and the color of your choosing, then present this view and everything behind should be darkened.
这篇关于当另一个视图显示时,如何使我的背景视图变暗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文