Tag: 设备

UISplitViewController和方向 – iOS <5.0

我正在使用一个splitviewcontroller作为我的应用程序的rootview。 我需要将login和注册视图显示为splitviewcontroller上方的模式视图。 当我尝试从splitViewController的rootview的viewdidAppear方法呈现login/ reg视图,它不显示。 我尝试使用下面的代码从Appdelegate的didFinishLaunching方法呈现login/注册视图 [self.window.rootViewController presentModalViewController:self.navController animated:NO]; 它的工作。 我的问题是,应用程序支持两个风景方向,但是当我在设备中运行它,无论在哪个方向我拿着设备,我只得到作为方向的LandscapeRight。 所以,如果我在LandscapeLeft方向持有该设备,应用程序与login屏幕颠倒。 我在info.plist上使用LandscapeLeft&Right支持方向。 请帮我解决这个问题。 当我们将splitViewcontroller作为应用程序的rootview时,我们将如何呈现视图? 在iOS 5.0(仅限于)中,我能够显示来自splitviewcontroller的rootview控制器 – viewdidAppear方法的login视图。 在所有其他操作系统版本中,这种情况不起作用,我需要从Appdelegate的didFinishLaunching方法中提出。

iOS:初始界面方向在plist中被忽略

我试图将我的应用程序的初始方向设置为UIInterfaceOrientationLandscapeLeft 我不能得到 'Initial interface orientation'[UIInterfaceOrientation] 覆盖数组中的第一个项目 'Supported interface orientations'[UISupportedInterfaceOrientations] 我注意到一个iPhone应用程序总是以'肖像(底部主页button)'开头,数组是: 'Supported interface orientations'[UISupportedInterfaceOrientations] Portrait (bottom home button) Landscape (left home button) Landscape (right home button) 这是预期的。 如果在“摘要”页面上将“肖像主页底部”buttonclosures,则返回上一页,然后数组顺序改变,肖像(底部主页button)移动到底部。 Landscape (left home button) Landscape (right home button) Portrait (bottom home button) 当我运行的应用程序现在开始景观(左主页button),因为这现在是列表的顶部。 这很好 但 当我添加 'Initial interface orientation'[UIInterfaceOrientation] 并将其设置为 Landscape (right home button) 它被忽略,并使用数组中的第一个项目 Landscape (left home […]

身份“iPhone开发人员”不匹配钥匙串中的任何有效的,未过期的证书/私钥对

我想testing我的应用程序在设备中,我坚持了几个小时这个错误: 身份“iPhone开发人员”不匹配钥匙串中的任何有效的,未过期的证书/私钥对 我已经按照这个指南 ,我在这里search了类似的问题在stackoverflow。 这可能有所帮助:在我的配给configuration文件中,我的证书的“有效签名标识未find”,我的“存档”选项卡为空。 你能帮忙的话,我会很高兴。

如何从模拟器(IOS)获取Iphonetypes

有很多解决scheme来找出哪些设备应用程序正在运行。 iOS:如何确定Swift中当前的iPhone /设备模型? 但是在模拟器中运行,我们只能检测到它是模拟器,而不是什么types的模拟器(iphone5,6,6s等) 我们如何用模拟器testing不同的逻辑取决于设备types? 或者我如何检测代码中模拟的设备?

旋转UIAlertView

我创build了一个自定义的UIAlertView(通过inheritance它的子类和它的show函数),它有一些自定义的子视图,并且是非标准的大小。 当我创build并显示它时,它工作正常,但是,当设备旋转时,警报会旋转,然后返回到其默认大小。 任何想法什么function重写 – 或者我应该调整UIViewController? 谢谢,彼得

自动导出和设备定位

我正在开发一个supports portrait and landscape modes的应用程序。 我正在使用auto layout to arrange my views 。 正如我一直在阅读很多职位,我已经意识到,开发人员通常使用以下方法之一。 1.第一种方法: 实现UIViewController:updateConstraints方法并根据设备方向更新约束。 2.第二种方法: 实现UIViewController:viewWillLayoutSubviews方法并根据设备方向更新约束。 任何人都可以告诉我什么是最好的方法来使用? 我一直在寻找结合自动旋转和自动布局的最佳实践,现在还没有。 谢谢。

扫描设备在LANnetworking中的方式

我想在局域网内进行扫描以find链接的设备。 我正在为IOS开发一个IOS应用程序,我该怎么办?

如何限制我的iPhone应用程序,不包括iPod touch?

如何限制我的iPhone应用程序,不包括iPod touch? 我不希望我的应用程序在iPod Touch上可用,在info.plist中是否有一个属性,我可以用它来指定这个,或者这是我在itunesconnect上设置时遇到的情况?

iOS 6 – 如何在方向更改时运行自定义代码

我正在创build一个游戏,让设备处于横向或横向的方向,玩家可以在暂停时更改方向。 当他们这样做时,我需要改变游戏根据方向来解释加速计的方式。 在iOS 5中,我使用了willRotateToInterfaceOrientation来捕获更改并更改我的variables,但在iOS6中已弃用。 我现有的代码如下所示: if(toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) rect = screenRect; else if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight){ rect.size = CGSizeMake( screenRect.size.height, screenRect.size.width ); GameEngine *engine = [GameEngine sharedEngine]; if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft){ engine.orientation = -1; } else { engine.orientation = 1; } } 我明白,replace是UIViewController类中的viewWillLayoutSubviews方法。 我在cocos2d 2.1中构build了这个游戏,并且在演示项目中似乎没有UIViewController类,所以我不清楚如何合并它以及代码应该如何工作。

如何在iOS真实设备上设置假GPS位置

目前我必须testing应用程序,并在真实的IOS 7设备上设置不同的假GPS位置。 在Android上,我使用“我的假位置”。 不幸的是,我没有findIOS 7相同的应用程序。任何想法来解决我的问题?