PageMenu / PageMenu

A paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram)
BSD 3-Clause "New" or "Revised" License
5.27k stars 899 forks source link

pagemenu is hiding my bottom part of the view #394

Open vuppalasivakumar opened 7 years ago

vuppalasivakumar commented 7 years ago

my view is hiding on loading for the first time. if move to the second tab and come back it is showing fine as image 2. simulator screen shot 12 jul 2017 10 45 45 simulator screen shot 12 jul 2017 10 48 00

and corresponding code is super.viewDidLoad() controllerArray.removeAll()

    let ACTIVE_CUSTOMERS:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ACTIVECUSTOMERSLISTViewController") as! ACTIVECUSTOMERSLISTViewController
    ACTIVE_CUSTOMERS.title = "ACTIVE CUSTOMERS"
    controllerArray.append(ACTIVE_CUSTOMERS)

    let INACTIVE:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "INACTIVECUSTOMERSViewController") as! INACTIVECUSTOMERSViewController
    INACTIVE.title = "INACTIVE CUSTOMERS"
    controllerArray.append(INACTIVE)
    let DEFAULTERS:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "DEFAULTERSViewController") as! DEFAULTERSViewController
    DEFAULTERS.title = "DEFAULTERS"
    controllerArray.append(DEFAULTERS)
    let ALL:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ALLViewController") as! ALLViewController
    ALL.title = "ALL"
    controllerArray.append(ALL)
    let parameters: [CAPSPageMenuOption] = [
        .scrollMenuBackgroundColor(UIColor(red: 17/255, green: 173/255, blue: 228/255, alpha: 1)),

        .selectionIndicatorColor(UIColor(red: 17/255, green: 131/255, blue: 177/255, alpha: 1)),
        .bottomMenuHairlineColor(UIColor.white),
        .menuItemFont(UIFont(name: "HelveticaNeue", size: 13.0)!),
        .menuHeight(40.0),
        .menuItemWidth(150.0),
        .centerMenuItems(true),
        .unselectedMenuItemLabelColor(UIColor.white)
    ]
    pageMenu = CAPSPageMenu(viewControllers: controllerArray, frame: CGRect(x: 0.0, y: 64.0, width: self.view.frame.width, height: self.view.frame.height - 64), pageMenuOptions: parameters)

    self.addChildViewController(pageMenu!)
    self.view.addSubview(pageMenu!.view)

    pageMenu!.didMove(toParentViewController: self)

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

override var shouldAutomaticallyForwardAppearanceMethods : Bool {
    return true
}
override func shouldAutomaticallyForwardRotationMethods() -> Bool {
    return true
}
hungvh1904 commented 7 years ago

Your answer at : https://github.com/PageMenu/PageMenu/issues/354.