我遇到了PageMenu的问题

时间:2018-03-17 07:30:23

标签: ios swift uiviewcontroller

当我使用PageMenu Framework并将所有代码放入PageMenu但我在控制器中显示空白区域时,我遇到了这个问题。任何人都有这种问题的解决方案。我知道如何删除它。

Blow我为PageMenu提供了完整的代码

enter image description here

import UIKit
import PageMenu

class TradingHistoryVC: UIViewController {

@IBOutlet weak var pagerView: UIView!

var controllerArray : [UIViewController] = []
var pageMenu : CAPSPageMenu?

override func viewDidLoad() {
    super.viewDidLoad()


     navigationController?.navigationBar.topItem?.title = ""
    // Do any additional setup after loading the view.
}

override func viewDidAppear(_ animated: Bool) {
    pager()
}

func pager()
{
    let buy = storyboard?.instantiateViewController(withIdentifier: "TradingSuccessfullyVCSID") as! TradingSuccessfullyVC
    buy.parentNavigationController = navigationController!
    buy.title = "Trading Successfully"
    controllerArray.append(buy)

    let sell = storyboard?.instantiateViewController(withIdentifier: "GlobalTradingVCSID") as! GlobalTradingVC
    sell.parentNavigationController = navigationController!
    sell.title = "Global Trading"
    controllerArray.append(sell)



    // Customize menu (Optional)
    let parameters: [CAPSPageMenuOption] = [
        .scrollMenuBackgroundColor(UIColor(red: 72/255.0, green: 175/255.0, blue: 230/255.0, alpha: 1.0)),
        .viewBackgroundColor(UIColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1.0)),

        .selectionIndicatorColor(UIColor(red: 255/255, green: 255/255, blue: 255/255, alpha: 1.0)),
        .addBottomMenuHairline(false),
        .menuItemFont(UIFont(name: "Times New Roman", size: 16)!),
        .menuItemWidth((self.pagerView.frame.width-30)/2),
        .menuHeight(50.0),
        .enableHorizontalBounce(true),
        .menuItemWidthBasedOnTitleTextWidth(false),
        .selectedMenuItemLabelColor(UIColor.white),

        .unselectedMenuItemLabelColor(UIColor.white),
        .menuItemSeparatorWidth(4.5),
        .useMenuLikeSegmentedControl(false),
        .menuItemSeparatorRoundEdges(true),
        .selectionIndicatorHeight(2.0),
        .menuItemSeparatorPercentageHeight(0.0),
        ]

    // Initialize scroll menu
    pageMenu = CAPSPageMenu(viewControllers: controllerArray, frame: CGRect(x: 0.0, y: 0.0, width: self.pagerView.frame.width, height: self.pagerView.frame.height), pageMenuOptions: parameters)

    self.pagerView.addSubview(pageMenu!.view)

    // End Pagemenu
}


@IBAction func btnMenuAction(_ sender: Any) {
    toggleSideMenuView()
}
}

如果有人有其解决方案PLZ。请帮忙解决。

0 个答案:

没有答案