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.frame = frame;
**[self.view setAlpha:.30f];
[self.settingView setAlpha:1.0f];**
[UIView commitAnimations];
我希望背景模糊,除了setupView。但整个观点正在受到影响。我做错了什么?
答案 0 :(得分:0)
您在视图上设置alpha,但如果您只想让背景透明 - 我认为这就是'模糊'的意思 - 您需要将背景颜色设置为透明:
myView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.3];