iOS Dim background when a view is shown

前端 未结 4 886
余生分开走
余生分开走 2020-12-24 14:50

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. I

4条回答
  •  醉话见心
    2020-12-24 15:25

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

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

提交回复
热议问题