开发者

subview (like popout effect)

settingView = [[UIView alloc] initWithFrame:CGRectMake(300,-400, 400, 325)];

settingView.backgroundColor = [UIColor whiteColor];

[self.view addSubview:settingView];


CGRect frame = settingView.frame;

[UIView beginAnimations:nil context:NULL];

[UIView setAnimationDuration:.500];

frame.origin.y = 0;

settingView.fram开发者_如何学编程e = frame;

**[self.view setAlpha:.30f];

[self.settingView setAlpha:1.0f];**

[UIView commitAnimations];

I want the background to be blurred off, except settingView. But the whole view is being affected. What am I doing incorrectly?


You are setting alpha on the view, but if you only want the background to be transparent – I assume that is what you mean by 'blurred' – you need to set the background color to be transparent instead:

myView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.3];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜