UIModalPresentationFullScreen - TransitionAnimation 背后的背景颜色
我目前正在构建一个通用应用程序。
用户点击按钮后,我通过以下方式在模态视图中呈现一些设置:
viewCtrl.modalPresentationStyle = UIModalPresentationFullScreen;
viewCtrl.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:viewCtrl animated:YES];
在 iPhone 和 iPad 上,两种 Transitionsstyle 看起来相同。现在的问题是,在 iPad 上,倾斜视图后面的背景是白色的。这个白色的背景看起来很丑。 在 iPhone 上它是黑色的,正如它应该的那样。
我还尝试向我的 [UIApplication window] 添加黑色背景视图,
UIView *bgView = [[UIView alloc] init];
[bgView setBackgroundColor:[UIColor blackColor]];
[window addSubview:bgView];
但这没有什么区别。
I'm currently building a universal app.
After the user taps a button, I present some settings in a modal View in the following way:
viewCtrl.modalPresentationStyle = UIModalPresentationFullScreen;
viewCtrl.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:viewCtrl animated:YES];
On the iPhone and iPad both Transitionsstyles look the same. Now the problem is, on the iPad the background, behing the tilting view, is white. This white background just looks ugly.
On the iPhone it is black, as it is supposed to be.
I also tried adding a black backgroundview to my [UIApplication window]
UIView *bgView = [[UIView alloc] init];
[bgView setBackgroundColor:[UIColor blackColor]];
[window addSubview:bgView];
but it doesn't make a difference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这就像将 UIWindow 背景颜色设置为黑色一样简单。例如,如果您在 IB 中打开 MainWindow.xib,您应该能够在那里设置背景 - 或者在 AppDelegate 中您应该能够设置 UIWindow 的背景。
I think it is as simple as setting the UIWindow background color to black. For example, if you open the MainWindow.xib in IB, you should be able to set the background there - or in your AppDelegate you should be able to set the background of the UIWindow.