开发者

dimming a UIView

开发者 https://www.devze.com 2023-01-15 05:10 出处:网络
Can someone tell me how do I achieve the UIActionSheet like behavior? I have a view that slides from bottom on button click. Now when this happens, I want my parent view to dim out and this \"scrolled

Can someone tell me how do I achieve the UIActionSheet like behavior? I have a view that slides from bottom on button click. Now when this happens, I want my parent view to dim out and this "scrolled-up" view to remain sharp.

What's happening because of

[parentView addsubview: scrolledupView] 

[parentView setBackgroundColor=[UIColor blackColor]];

[parentView setAlpha:0.5f];

is that both the views dim out.

开发者_如何转开发

How could I dim out only the parent view with dimming out my "scrolled-up" view.

In essence, I am trying to replicate the UIActionSheet behavior.

Also tell me if this could result in a rejection on app store?


You can create empty view:

  1. Put it above your parent view or place it over the space not covered by scrollview.
  2. Change it's background to black.
  3. Set required opacity.

Edit: To add the view that scrolls up on top of this empty view, try:

[parentView insertSubview:slidingView aboveSubview:dimmingView];

or

[parentView insertSubview:slidingView atIndex:0];
0

精彩评论

暂无评论...
验证码 换一张
取 消