这是我的问题。我的应用程序以横向模式启动,看起来像这样
我有几张门的图像,如下所示:
在 AppDelegate didFinishLaunchingWithOptions 中,我添加了以下代码,目的是将两个门图像放置在与启动图像相同的位置,然后制作动画以显示门打开。
{
myImageWalk = [[UIImageView alloc] initWithFrame:CGRectMake(272,0, 286, 748)];
myImageWalk.image = [UIImage imageNamed:@"leftdoorlandscape.png"];
[window addSubview:myImageWalk];
[window bringSubviewToFront:myImageWalk];
myImageWalk2 = [[UIImageView alloc] initWithFrame:CGRectMake(512,0, 286, 748)];
myImageWalk2.image = [UIImage imageNamed:@"rightdoorlandscape.png"];
[window addSubview:myImageWalk2];
[window bringSubviewToFront:myImageWalk2];
[self doAnimate:CGRectMake(-286, 20, self.myImageWalk.frame.size.width, self.myImageWalk.frame.size.height)];
[self doAnimate1:CGRectMake(748, 20, self.myImageWalk2.frame.size.width, self.myImageWalk2.frame.size.height)];
}
唯一的问题是结果是:
为什么图像是直上直下的,它会在侧面显示?