lucoceano/Pager

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

Opened this issue · 3 comments

fayme commented

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!

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?

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 I will have a look this weekend