uideviceorientation

    0熱度

    1回答

    我視圖控制器1,2和3鏈這樣,圖2和3都帶有模態塞格斯: 當用戶已經在橫向模式下的一小會兒(不一致時間),開卷到父視圖,然後旋轉手機回畫像,與這些symbolicated崩潰報告應用程序崩潰: 3退繞至2: 終止應用程序未捕獲到由於例外 'NSInvalidArgumentException' 的,原因是: ' - [NSConcreteMutableData rotatesOnDeviceRot

    0熱度

    3回答

    在Objective-C,你可以這樣做: if (UIDeviceOrientationIsPortrait(deviceOrientation) || UIDeviceOrientationIsLandscape(deviceOrientation)) { AVCaptureVideoPreviewLayer *previewLayer = (AVCaptureVideoPreview

    1熱度

    2回答

    我正在創建自定義鍵盤,我不想支持橫向模式。因此,如果用戶將設備旋轉到橫向模式,則鍵盤仍然處於縱向模式。我曾嘗試以下方法: -(BOOL)shouldAutorotate { return NO; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInte

    3熱度

    1回答

    我正在使用此觀察者:UIDeviceOrientationDidChangeNotification來檢測用戶何時更改設備方向。當方向改變爲風景時,我提出一個新的UIViewController或在他將其更改回肖像時關閉此UIViewController。當用戶開始旋轉的時間和快速的設備數量 我的問題開始,然後應用程序都瘋了,直到我得到這個錯誤: Warning: Attempt to prese

    1熱度

    1回答

    功能覆蓋 func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) { } 當我建立和iPad設備上運行,但它在移動設備(iPhone 5,6,7 ...)工作正常,不會被觸發。如何解決這個?? 在此先感謝!

    0熱度

    1回答

    我的應用程序中有一個問題,我剛發現,一旦將應用程序放到實際的iPad上,就無法在模擬器中看到它。問題是,當我將iPad保持橫向模式時,如果我將iPad翻回到某個角度,iPad會保持橫向模式,但視圖會在仍處於橫向模式時切換到縱向模式。在我的代碼中,我有一個名爲screenRotated()的函數,它是UIDeviceOrientationDidChangeNotification的觀察者。我的功能s

    0熱度

    2回答

    我想在電影播放時旋轉我的視圖控制器。 我的問題可能是重複的,但當我發現堆棧溢出時,我嘗試了很多方法。但所有代碼都不起作用。可能是我把代碼以錯誤的方式。 override var shouldAutorotate: Bool { return false } override var supportedInterfaceOrientations: UIInterfaceOrienta

    0熱度

    1回答

    即使用戶鎖定了他的方向,是否有任何方法檢測屏幕方向?我的應用程序使用自定義相機視圖,我希望能夠根據方向以橫向或縱向保存圖像。我目前使用下面的代碼來檢測方向,但是這隻有在用戶沒有鎖定它時纔有效。 override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinat

    -1熱度

    2回答

    當我水平傾斜iPad設備時,我獲得了一個奇怪的行爲。 通知: NSNotificationCenter.defaultCenter().addObserver(self, selector: "MySelector", name: UIDeviceOrientationDidChangeNotification, object: nil) 已被觸發,並調用 「MySelector」 導致無用U

    2熱度

    2回答

    我有一個應用程序,其中嵌入了一個NavigationController中的幾個VC。 我需要所有VC都以肖像方向鎖定,只有縱向和橫向都鎖定一個VC。 我已經嘗試不同的方法,這一次是爲我工作: extension UINavigationController { public override func supportedInterfaceOrientations() -> Int { ret