我有一个以模态方式显示的 View ,在显示它之前,我将其背景颜色设置为透明...
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
MyViewController_iPhone *myVC = [[MyViewController_iPhone alloc] initWithNibName:@"MyView" bundle:nil];
[myVC.view setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.0]]
[[self navigationController] presentModalViewController:myVC animated:YES];
[myVC release];
}
当 View 在屏幕上向上动画时,背景是透明的,但是一旦完成向上动画, View 的背景就会回到原来的不透明白色,为什么?
预先感谢您的帮助!
最佳答案
根据这篇文章Transparent Background with a Modal UIViewController这是不可能的。你想最终得到什么?
此链接似乎描述了您想要实现的目标。 http://doganberktas.com/2010/05/18/adding-transparent-modal-view-programatically-iphone/
关于iphone - 为什么我的 UIView 在加载完成后不保持透明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3622883/