问题与ViewController我使用PageMenu第三方库

时间:2018-03-16 05:18:03

标签: uiview viewcontroller

当Controller出现时,它显示空白区域。当我单击另一个选项卡并返回到同一选项卡时。它显示了白色空间。然后工作正常。让我知道如何删除其中的空白区域(白色空间显示为BTC买入MB的上方)

屏幕截图:

Click for Screenshot

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

func pager()
{
    let buy = storyboard?.instantiateViewController(withIdentifier: "BuyMBVCSID") as! BuyMBVC
    buy.parentNavigationController = navigationController!
    buy.title = "Buy MB"
    controllerArray.append(buy)

    let sell = storyboard?.instantiateViewController(withIdentifier: "SellMBVCSID") as! SellMBVC
    sell.parentNavigationController = navigationController!
    sell.title = "Sell MB"
    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)/3),
        .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
}

1 个答案:

答案 0 :(得分:0)

更改

.selectionIndicatorColor(UIColor(red: 255/255, green: 255/255, blue: 255/255, alpha: 1.0))

.selectionIndidcatorColor(UIColor.clear)

应该做的伎俩