让iPhone特定的应用程序在iPad上运行,以满足苹果的要求
我的应用程序已经在AppStore中运行了几个月了,而且一直只在iPhone上运行。我最近提交了一个更新,但被拒绝了,因为该应用程序不能在iPad上运行。被拒绝的确切原因是: 拒绝理由: 2.10:iPhone应用程序也必须在iPad上运行,无需修改,分辨率为iPhone,分辨率为iPhone 3GS的2倍 我需要在Xcode中做些什么才能让我的应用程序在带有2X图标的小盒子中的iPad上运行 任何提示和说明都将不胜感激 编辑 这是我的信息列表。这是我的第一个应用程序,我想我最初确实选择了将其设置为选中“universal”。现在有没有一个简单的方法让我纠正这个问题让iPhone特定的应用程序在iPad上运行,以满足苹果的要求,iphone,ios,xcode,app-store,appstore-approval,Iphone,Ios,Xcode,App Store,Appstore Approval,我的应用程序已经在AppStore中运行了几个月了,而且一直只在iPhone上运行。我最近提交了一个更新,但被拒绝了,因为该应用程序不能在iPad上运行。被拒绝的确切原因是: 拒绝理由: 2.10:iPhone应用程序也必须在iPad上运行,无需修改,分辨率为iPhone,分辨率为iPhone 3GS的2倍 我需要在Xcode中做些什么才能让我的应用程序在带有2X图标的小盒子中的iPad上运行 任何提示和说明都将不胜感激 编辑 这是我的信息列表。这是我的第一个应用程序,我想我最初确实选择了将其设
首先要弄清楚为什么你的应用程序在iPad上还不能运行。大多数为iPhone开发的应用程序在iPad上运行良好(在兼容模式下),无需修改;如果你的孩子没有,你必须采取措施防止它。您是否依赖某些硬件功能?对正在运行的设备做出毫无根据的假设?你的应用程序在iPad上运行时是如何失败的
一旦你弄明白了为什么它不起作用,你将比现在更接近解决问题。要让你的应用程序在iPad上以iPhone兼容模式运行,你只需要为iPhone构建应用程序
从应用程序的plist(nib base、xib和storyboard)和目标构建设置目标设备系列中删除所有iPad引用。我也遇到了同样的问题,在做了以下更改后,我能够在iPad上运行我的应用程序
我已经用这个场景解决了同样的问题 您应该在资源文件夹中检查正常图像和视网膜图像 当调试
无法加载从具有标识符的捆绑包中的nib引用的“image.png”图像时,也可能会出现此错误
普通iPhone应用程序必须在iPad上以(1x和2x)模式运行,无需修改。您可以使用SDK模拟器检查这一点
苹果iOS开发者门户中心的应用商店审查指南中有一个很长的列表,其中列出了苹果在提交应用时审查的许多内容。仔细阅读。我会尽力解释我的问题和解决方案
我有一个iPhone
唯一的应用程序,大部分是纵向的,但是,由于1个或2个UIViewControllers
必须在所有UIInterfaceOrientations
中,我必须在我的plist
中启用所有UIInterfaceOrientations
当在iPad
上启动应用程序时,该应用程序在横向旋转并放在桌子上(也有UIDeviceOrientationFaceUp
),整个应用程序在横向显示,这让我的UI完全混乱
我在plist或发布屏幕上没有任何与iPad相关的代码/设置(我在发布屏幕上使用的是.xcsets)
我通过在我的AppDelegate.m
中添加一行代码修复了这个问题,它设置了状态栏方向,以强制应用程序处于纵向模式
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
//Further setup
}
我在使用cocos2d2.0时也遇到了同样的问题
我的问题是,这个项目经过了几年的发展,并携带了一些现在已经过时的文件,如RootViewController、UIViewController和MyRootViewController等
他们当时是工作的,但很明显,他们已经在今天的审查委员会上升起了旗帜,因为我收到了“所有iPhone应用程序都必须在iPad上工作”的拒绝通知。在大声尖叫并最终接受失败后,我认为政策使得只制作iPhone应用程序变得非常困难。如果我错了,请告诉我
尽管我当时(现在仍然)对此感到不安,但我想现在我至少可以用一个更优雅的解决方案来解决这个基本问题:设备旋转+内容旋转。我最终使用了最近一个项目中的一些东西,这个项目正在进行中,看起来更加优雅,实际上也很有效:只需将MyNavigationController添加到AppDelegate的顶部即可
我在下面添加了代码。我相信这是可以改进的。请评论,如果你可以提高它
因此,我能够删除旧的RootViewController和MyRootViewController文件,因此现在更易于维护。无论如何,我都不太明白他们的目的。好家伙
以下是我显示和匹配设备方向+内容方向的解决方案:
在AppDelegate.h中,我必须声明我在做什么:
//头条
@接口MyNavigationController:UINavigationController
@结束
//在AppDelegate.h接口内部
MyNavigationController*导航控制器
//@end之前的文件底部
@属性(只读)MyNavigationController*navController
下面是我的AppDelegate.m顶部的代码
@MyNavigationController的实现
// The available orientations should be defined in the Info.plist file.
// And in iOS 6+ only, you can override it in the Root View controller in the "supportedInterfaceOrientations" method.
// Only valid for iOS 6+. NOT VALID for iOS 4 / 5.
-(NSUInteger)supportedInterfaceOrientations {
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
if (orientation == UIDeviceOrientationPortrait) {
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// [director_ pushScene: [IPAD scene]];
} else {
[[CCDirectorIOS sharedDirector] pushScene:[VerticalDisplayLayer scene]];
return UIInterfaceOrientationMaskPortrait;
}
} else if (orientation == UIDeviceOrientationLandscapeLeft) {
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// [director_ pushScene: [IPAD scene]];
} else {
[[CCDirectorIOS sharedDirector] pushScene:[MainMenuScene scene]];
}
} else if (orientation == UIDeviceOrientationLandscapeRight) {
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// [director_ pushScene: [IPAD scene]];
} else {
[[CCDirectorIOS sharedDirector] pushScene:[MainMenuScene scene]];
}
} else if (orientation == UIDeviceOrientationPortraitUpsideDown) {
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
} else {
[[CCDirectorIOS sharedDirector] pushScene:[VerticalDisplayLayer scene]];
return UIInterfaceOrientationMaskPortraitUpsideDown;
}
} else {
//do nothing
}
return UIInterfaceOrientationMaskLandscape;
}
以下是我必须解决这个问题的原因:
我需要横向和纵向模式来显示不同的场景
下面是一些描述情况的截图
您是否尝试过在iPad模拟器上运行它?你有@2x图像吗?这是我的想法,但我将当前版本下载到我的iPad上,得到默认的UIT缩写“First View”和“Second View”。我不使用任何硬件功能。我的应用程序是一个简单的应用程序,捕捉运动员训练课程的细节。所有数据都在文本字段中捕获并存储在核心数据中。是否有我应该检查的Xcode设置?是否可能是您将应用程序设置为通用应用程序(即在两台设备上正常运行的应用程序),而不是仅在iPhone上运行的应用程序,然后未能实现
//this is the one for iOS 6
- (BOOL)shouldAutorotate {
//NSLog(@"MyNavigationController - should Rotate ToInterfaceOrientation ...");
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
// iPhone only
if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ) {
//NSLog(@"MyNavigationController - should Rotate iPhone");
if (orientation == UIDeviceOrientationPortrait) {
//NSLog(@"should Rotate iPhone orientation is Portrait");
[[CCDirectorIOS sharedDirector] pushScene:[VerticalDisplayLayer scene]];
return UIInterfaceOrientationMaskPortrait;
}
if (orientation == UIDeviceOrientationPortraitUpsideDown) {
//NSLog(@"should Rotate iPhone orientation is PortraitUpsideDown");
[[CCDirectorIOS sharedDirector] pushScene:[VerticalDisplayLayer scene]];
return UIInterfaceOrientationMaskPortraitUpsideDown;
}
if (orientation == UIDeviceOrientationLandscapeLeft) {
//NSLog(@"should Rotate iPhone orientation is Landscape Left");
return UIInterfaceOrientationMaskLandscape;
}
if (orientation == UIDeviceOrientationLandscapeRight) {
//NSLog(@"should Rotate iPhone orientation is Landscape Right");
return UIInterfaceOrientationMaskLandscape;
}
return TRUE;
}
//return UIInterfaceOrientationIsLandscape(interfaceOrientation);
if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ) {
//NSLog(@"MyNavigationController - should Rotate iPad");
return TRUE;
}
return TRUE;
}
// Supported orientations. Customize it for your own needs
// Only valid on iOS 4 / 5. NOT VALID for iOS 6.
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
// iPhone only
if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone )
return TRUE;
//return UIInterfaceOrientationIsLandscape(interfaceOrientation);
if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad )
return TRUE;
// iPad only
// iPhone only
//return UIInterfaceOrientationIsLandscape(interfaceOrientation);
return TRUE;
}
// This is needed for iOS4 and iOS5 in order to ensure
// that the 1st scene has the correct dimensions
// This is not needed on iOS6 and could be added to the application:didFinish...
-(void) directorDidReshapeProjection:(CCDirector*)director
{
if(director.runningScene == nil) {
// Add the first scene to the stack. The director will draw it immediately into the framebuffer. (Animation is started automatically when the view is displayed.)
// and add the scene to the stack. The director will run it when it automatically when the view is displayed.
[director runWithScene: [MainMenuScene scene]];
}
}
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
// Assuming that the main window has the size of the screen
// BUG: This won't work if the EAGLView is not fullscreen
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGRect rect = CGRectZero;
//NSLog(@"MyNavigationController - Will RotateToInterfaceOrientation ...");
if(toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
rect = screenRect;
} else if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
rect.size = CGSizeMake( screenRect.size.height, screenRect.size.width );
}
CCDirector *director = [CCDirector sharedDirector];
CCGLView *glView = (CCGLView *)[director view];
glView.frame = rect;
}
@end