在IOS中查看转换[要更改背景]

在IOS中查看转换[要更改背景],ios,xcode,background,transitions,Ios,Xcode,Background,Transitions,我对过渡有些怀疑。问题是,当我进行转换时: Register *register1 = [[Register alloc] initWithNibName:nil bundle:nil]; self.registerData = register1; register1.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:register1 animated:Y

我对过渡有些怀疑。问题是,当我进行转换时:

Register *register1 = [[Register alloc] initWithNibName:nil bundle:nil];
self.registerData = register1;
register1.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:register1 animated:YES];
过渡的背景显示为黑色,如下图所示:


你们觉得我能解决这个问题吗?我想有一个图像来取代这个黑色背景。谢谢

我也有过同样的问题。在我的例子中,我在主窗口的窗口中插入了一个
UIImageView
。请尝试以下代码,查看这是否是插入图像的正确位置:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window.backgroundColor = [UIColor redColor];
}
要使用图像而不是颜色,请执行以下操作:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary 
    UIImageView* background = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
    background.image = [UIImage imageNamed:@"Background.png"];
    [self.window addSubview:background];
}

我曾经有过同样的问题。在我的例子中,我在主窗口的窗口中插入了一个
UIImageView
。请尝试以下代码,查看这是否是插入图像的正确位置:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window.backgroundColor = [UIColor redColor];
}
要使用图像而不是颜色,请执行以下操作:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary 
    UIImageView* background = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
    background.image = [UIImage imageNamed:@"Background.png"];
    [self.window addSubview:background];
}

彼得!你到底是怎么做的,把图像作为过渡的背景?也许这对我来说比普通颜色更好!谢谢颜色只是一个快速测试,看看这是否是适合你的地方。我使用了XCode给我的应用程序模板。此模板包含MainWindow.xib。使用Interface Builder打开此窗口,您将看到对象“窗口”。只要把UIImageView拖进去,我就这么做了。。。博恩机会;)彼得!你到底是怎么做的,把图像作为过渡的背景?也许这对我来说比普通颜色更好!谢谢颜色只是一个快速测试,看看这是否是适合你的地方。我使用了XCode给我的应用程序模板。此模板包含MainWindow.xib。使用Interface Builder打开此窗口,您将看到对象“窗口”。只要把UIImageView拖进去,我就这么做了。。。博恩机会;)