Tag: 定位

只从风景视图返回到肖像应用程序

我有一个应用程序,只能在肖像模式,但是,有一个视图,需要支持肖像以及风景模式。 任何时候我从这个视图返回应用程序的其余部分搞砸了。 需要支持两个方向的视图包含用于播放直播的webview。 简单的设置shouldAutorotateToInterfaceOrientation不起作用。 呈现模态视图控制器的伎俩既不。 删除和插入根视图的技巧也不起作用。 我害怕使用[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait](实际工作),因为它是私人API。

方向肖像和PortraitUpSideDown仅适用于一个窗口

我有10个窗口。 最初的窗口是loginWindow,我想为Portrait和PortraitUpSideDown设置方向。 对于其余的窗户将有风景和人像方向。 在Tiapp.xml中 <key>UISupportedInterfaceOrientations~iphone</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> 其中为我的应用程序设置所有的方向,使肖像,portraitupsidedown,landscapeLeft和landscapeRight。 我只需要这些用于LoginWindow的肖像和portraitUpSideDown。 其余的窗户都有肖像,portraitupsidedown,landscapeLeft和landscapeRight的所有方向。 任何人都可以build议我怎样才能得到我的应用程序的这种行为。

以编程方式更改方向无法正常工作

我的整个应用程序是在portrait模式。 我只想在landscape模式下使用一个视图控制器(左)。 func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask { if let _navigationController = window?.rootViewController as? UINavigationController { if _navigationController.topViewController is FullScreenPlayerVC { return UIInterfaceOrientationMask.LandscapeLeft } } return UIInterfaceOrientationMask.Portrait } 这是我的控制器A. override func shouldAutorotate() -> Bool { return true } override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { return UIInterfaceOrientationMask.Portrait } 现在我推控制器B.这是我的控制器B. override func viewDidAppear(animated: Bool) […]

找不到IBeacon

有困难连接到IBeacon,我已经下载了定位应用程序,但它无法find我的IBeacon。 我也手动configurationibeacon但没有成功。 另一种方法是我已经下载了eBeacon应用程序,而我的IBeacon只能在中央外设中看到,而不在信标列表中。 我认为问题出在设备上。 这里是我的灯塔 。 任何想法将不胜感激。 谢谢! PS我在这里问了关于IBeacon连接问题的问题。

只允许一个视图控制器的所有方向

我知道这个问题已经在这里 , 这里和这里问了。 我尝试了所有可能的方法,但没有成功。 我试图在Swift(iOS 8)中开发一个应用程序,在这个应用程序中,只有一个视图控制器可以在所有方向上以只有肖像的方式被查看。 为此,我只在“目标” – >“常规” – >“设备方向”中启用了Portrait模式(因为除了一个视图控制器之外,我希望应用程序只能在纵向模式下操作)。 我已经添加了下面的代码到视图控制器,我想要在所有的方向进行操作: override func supportedInterfaceOrientations() -> Int { return Int(UIInterfaceOrientationMask.All.rawValue) } override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation { return UIInterfaceOrientation.LandscapeLeft; } override func shouldAutorotate() -> Bool { return true; } 但是不能以横向模式旋转。

框架不改变,而在iPad的方向

在我的根视图控制器的viewDidLoad,我添加了一个观察者的方向检测: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willRotateToInterfaceOrientation:duration:) name:@"UIDeviceOrientationDidChangeNotification" object:nil]; 添加了如下方法: – (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { NSLog(@"%f,%f",self.view.frame.size.width,self.view.frame.size.height); } 我期待的结果是768,1004的肖像和1004,768的景观。 但是我的结果是768,1004。 有时候这个人像是748,1024。 我不知道为什么这个奇怪的行为。 如果你知道解决scheme,请帮助我。 编辑这相同的代码在我的另一个项目中工作,我找不到他们之间的任何区别

适用于iOS的Flash Pro AS 3.0 Air,方向事件不起作用

我正在开发一个默认方向设置为Flash Air for iOS设置中的人像的应用程序; 并且自动方向closures。 但是,添加一个特定的影片剪辑后,我希望它检测方向是否改变,然后改变它的风景或肖像显示的位置。 问题是,如果我禁用自动定位,则不会调度StageOrientationEvent.ORIENTATION_CHANGE。 即使启用,侦听器也只会在方向更改为倒置或默认(不是风景) package { import flash.display.MovieClip; import flash.events.MouseEvent; import flash.display.Stage; import flash.events.StageOrientationEvent; import flash.display.StageOrientation; import flash.events.Event; public class NoteBook extends MovieClip { public var type: String = new String(); public var deviceHeight: Number = new Number(); private var nbp: NoteBookPic; public function NoteBook(DeviceHeight: Number = 720) { nbp = […]

iPad上的Cordovalocking方向失败

我正在使用cordova 3.5.0-0.2.6(最后一个稳定版本)。 我在lockingiPad设备方向时遇到问题。 在iPhone上它工作正常,但在iPad上的方向不locking。 我想locking整个应用程序,而不仅仅是页面。 这是我目前的config.xml: <?xml version="1.0" encoding="utf-8"?> <widget id="com.domain" version="version" xmlns="http://www.w3.org/ns/widgets"> <name>xxx</name> <description>Lorem ipsum</description> <access origin="*"/> <author email="x@x" href="https://x.com">x</author> <content src="index.html?platform=cordova"/> <feature …></feature> <preference name="permissions" value="none"/> <preference name="orientation" value="portrait"/> <preference name="show-splash-screen-spinner" value="true"/> <preference name="auto-hide-splash-screen" value="true"/> <preference name="prerendered-icon" value="true"/> <preference name="disallowoverscroll" value="true"/> <preference name="webviewbounce" value="false"/> <preference name="StatusBarOverlaysWebView" value="false"/> <preference name="StatusBarBackgroundColor" value="#000000"/> </widget> 生成的plist文件如下所示: <key>UISupportedInterfaceOrientations</key> […]

模拟真实iOS设备上的位置

是否有可能在iOS设备上模拟一个位置,比如我想在坐在牛津的时候在设备上模拟伦敦? 谢谢。

iOS通过指南针和位置增强现实感

我正在尝试像使用相机,指南针和位置一样开发一个迷你的“我周围”。 我想在我的屏幕上显示地方的图像。 目前我有我的位置和我的方向与指南针。 我想知道如何确定我想要显示的位置。 谢谢你的帮助 ;)