【问题标题】:subview (like popout effect)子视图(如弹出效果)
【发布时间】:2011-09-12 11:16:55
【问题描述】:
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];

我希望背景模糊,除了 settingView。但整个观点都受到了影响。我做错了什么?

【问题讨论】:

    标签: iphone ios ipad


    【解决方案1】:

    您正在视图上设置 alpha,但如果您只希望背景透明(我假设这就是您所说的“模糊”的意思),则需要将背景颜色设置为透明:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-07
      • 2022-11-24
      • 2012-11-18
      • 1970-01-01
      • 1970-01-01
      • 2020-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多