子视图(如弹出效果)

时间:2011-09-12 11:16:56

标签: iphone ios ipad

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。但整个观点正在受到影响。我做错了什么?

1 个答案:

答案 0 :(得分:0)

您在视图上设置alpha,但如果您只想让背景透明 - 我认为这就是'模糊'的意思 - 您需要将背景颜色设置为透明:

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