Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios ipad启动屏幕没有';t旋转_Ios - Fatal编程技术网

Ios ipad启动屏幕没有';t旋转

Ios ipad启动屏幕没有';t旋转,ios,Ios,我希望能够将ipad上的启动屏幕左右旋转。 我已经在.plist文件中启用了横向左右方向。我为LandscapeRight和LandscapeLeft添加了4个文件: Default-LandscapeRight@2x~ipad.png Default-LandscapeLeft@2x~ipad.png Default-LandscapeRight~ipad.png Default-LandscapeLeft~ipad.png 虽然这不重要,但在我的rootviewcontroller中,我

我希望能够将ipad上的启动屏幕左右旋转。 我已经在.plist文件中启用了横向左右方向。我为LandscapeRight和LandscapeLeft添加了4个文件:

Default-LandscapeRight@2x~ipad.png
Default-LandscapeLeft@2x~ipad.png
Default-LandscapeRight~ipad.png 
Default-LandscapeLeft~ipad.png
虽然这不重要,但在我的rootviewcontroller中,我有:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft); 
    return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
}
启动屏幕将加载,但不会旋转。
我做错了什么?

据我所知,设备在启动图像期间无法识别方向。默认情况下,这些启动图像-LandscapeRight@2x~ipad.png 违约-LandscapeLeft@2x~ipad.png 默认的LandscapeRight~ipad.png可以识别应用程序何时启动设备,然后设备会拍摄相应的飞溅图像。 默认的LandscapeLeft~ipad.png

如果你感兴趣的话,你可以做另一个解决方案。这只是我的想法而已

1为此创建UIIMageView,并将其作为子视图添加到窗口

2将iamge设置为该UIIMageView

3设置睡眠方法3-4秒。喜欢睡觉(4)

4当调用转到RootViewController时,管理图像的方向

像下面的方法 这是假设您在AppDelegate类中定义的将管理图像方向的方法

 -(void)checkOrientationforSplash:(UIInterfaceOrientation)interfaceOrentaion
    {
if (splashImageView.hidden==FALSE) {
    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
    if (interfaceOrentaion==UIInterfaceOrientationPortrait|| interfaceOrentaion==UIInterfaceOrientationPortraitUpsideDown) {
        UIImage *image=[UIImage imageNamed:@"Default-Portrait.png"];
        splashImageView.frame=CGRectMake(0.0, 0.0, image.size.width, image.size.height);
        [splashImageView setImage:image];

    }
    else {
        UIImage *image=[UIImage imageNamed:@"Default-Landscape.png"];
        splashImageView.frame=CGRectMake(0.0, 20.0, image.size.width, image.size.height);
        [splashImageView setImage:image];
    }
       }
}

5您可以在应用程序安装期间管理该图像表单,RoortViewController

6移除特定点的飞溅图像

 -(void)removeSplash
   {
     [splashImageView setHidden:YES];
   }

我希望它能对您有所帮助。

您可以使用自定义启动屏幕。@SarafarazBabi请详细说明。我认为定义横向左侧和右侧启动屏幕是自定义启动屏幕我的意思是你可以为启动屏幕创建一个类,并将其作为rootviewcontroller传递,1或2秒后只需按下你的homeview控制器…并在启动屏幕类中管理shouldautorotate…明白了吗?@SarafarazBabi好主意!谢谢我想知道为什么我的方式不起作用?是正确的屏幕加载,还是你只是在它已经可见时错过了旋转?这是一个好主意!谢谢顺便说一句,我的启动屏幕也没有按应有的方式启动!(即,如果我左右握住它,它是同一个东西,它不会选择正确的飞溅)。