我有一个模态显示的视图,在显示之前,我将它的背景颜色设置为透明...
- (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];
}
当视图在屏幕上动画时,背景是透明的,但是一旦完成向上动画,视图的背景就会恢复到原始的不透明白色,为什么?
提前感谢您的帮助!
答案 0 :(得分:1)
根据这篇文章Transparent Background with a Modal UIViewController,它无法完成。你想要最终得到什么?
此链接似乎描述了您要实现的目标。 http://doganberktas.com/2010/05/18/adding-transparent-modal-view-programatically-iphone/