为什么我的 UIView 在加载完成后不保持透明?
我有一个以模态方式显示的视图,在显示它之前,我将其背景颜色设置为透明...
- (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];
}
当视图在屏幕上动画时,背景是透明的,但一旦完成向上动画,视图的背景回到原来不透明的白色,为什么?
预先感谢您的帮助!
I have a view being displayed modally and, before I display it, I set it's background color to transparent...
- (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];
}
As the view animates up onto the screen, the background is transparent, but as soon as it finishes animating upward, the view's background goes back to the original opaque white color, why?
Thanks in advance for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据这篇文章 Transparent Background with a Modal UIViewController 这是无法完成的。你想最终得到什么?
此链接似乎描述了您想要实现的目标。 http://doganberktas.com/2010/05 /18/adding-transparent-modal-view-programatically-iphone/
According to this post Transparent Background with a Modal UIViewController it cannot be done. What are you trying to end up with?
This link seems to describe what you're trying to achieve. http://doganberktas.com/2010/05/18/adding-transparent-modal-view-programatically-iphone/