我一直在寻找一种在翻转水平动画期间更改黑色背景颜色的方法,但到目前为止,没有任何方法对我有用。
This is what it looks like right now
如果有人能帮助我,我将非常感激!这是我用于动画的代码:
ViewController.h:
-(IBAction)howitworksbutton:(id)sender;
ViewController.m:
-(IBAction)howitworksbutton:(id)sender
{
howitworks *secondview = [[howitworks alloc] initWithNibName:nil bundle:nil];
secondview.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:secondview animated:YES];
}
我还创建了一个名为“howitworks”的新 UIViewController 子类。
问候,伊瓦尔
最佳答案
尝试设置应用程序委托(delegate)的窗口对象的背景颜色:
YourAppDelegate *delegate =[[UIApplication sharedApplication] delegate];
[[delegate window] setBackgroundColor:[UIColor redColor]];
我相信这是所有应用程序 View 背后的主要背景颜色。
关于iphone - 水平翻转动画期间的背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9417234/