Pager icon indicating copy to clipboard operation
Pager copied to clipboard

Tab doesn't take the whole screen width on landscape view

Open fayme opened this issue 9 years ago • 3 comments

Whenever i am rotating the app from portrait to landscape i want my view to take the whole space in the mode. Let me know if its possible to do!

fayme avatar Oct 05 '16 10:10 fayme

I just did some tests. I was able to hide the tabbar and navigation bar but I wasn't able to set the contentView to fullscreen. @lucoceano any thoughts?

lfarah avatar Oct 07 '16 16:10 lfarah

Code used:

    override func viewDidLoad() {
       // Some code

      NotificationCenter.default.addObserver(self, selector: #selector(ViewController.rotated), name:      NSNotification.Name.UIDeviceOrientationDidChange, object: nil)
    }
    func rotated() {
        if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) {
            tabsView?.isHidden = true
            self.navigationController?.isNavigationBarHidden = true
            print("landscape")
        }
        if UIDeviceOrientationIsPortrait(UIDevice.current.orientation) {
            tabsView?.isHidden = false
            self.navigationController?.isNavigationBarHidden = false
            print("Portrait")
        }
    }

lfarah avatar Oct 07 '16 16:10 lfarah

@lfarah I will have a look this weekend

lucoceano avatar Oct 07 '16 17:10 lucoceano