lucoceano / Pager

Pager is the simplest and best way to implement sliding view controllers in Swift
MIT License
232 stars 41 forks source link

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

Open fayme opened 8 years ago

fayme commented 8 years ago

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!

lfarah commented 8 years ago

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 commented 8 years ago

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")
        }
    }
lucoceano commented 8 years ago

@lfarah I will have a look this weekend