开发者

Transparency around UIWebView

I have a UIView with a "advertisement" and I want to be able to have a UIWebView pop开发者_开发问答up window appear over top of the advertisement.

I want to be able to have everything except the UIWebView become a dimmed black transparent.. Is this possible?

Let me know if this is clear or not. You see it on many websites

Thanks


UIView *vie=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 360, 480)];

[vie setOpaque:NO];

[vie setBackgroundColor:[UIColor clearColor]];


UIWebView *urwebiew=[[UIWebView alloc]initWithFrame:CGRectMake(40, 40, 200, 200)];


    //.................

[vie addSubview:urwebiew];


now the view is ready with transparent to use 


You can add a view over the entire screen with a small alpha (making it more (close to 0) or less (close to 1) transparent). By setting userInteractionEnabled to NO, you can prevent anything under this view from responding to touch events. Then add your UIWebView to that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜