开发者

Setting modal image view?

In the Epic Win iPhone app, they seem to have s开发者_Python百科ome sort of image view in the front of another view. How does one implement this?

Example:

Setting modal image view?


All you have to do is to create a new view and add it to the window. You can do that like this:

UIView *overlayView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
overlayView.backgroundColor = [UIColor colorWithWhite:0 alpha:.5];
[overlayView addSubview:<#imageView#>];
[self.view.window addSubview:overlayView];
[overlayView release];

Let me know if that works for you.


From above example it seems that they just added Imageview on self.view and they decrease alpha of self.view. It doesn't seems something triky.


That's very simple and there are probably a few ways to do it.

The simplest is probably to just add an image view as subview of the window.


Check out this CustomAlert Class. Shows you how to change the background of a UIAlertView.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜