【问题标题】:Issue With ViewController I am using PageMenu Third party libraryViewController 的问题我正在使用 PageMenu 第三方库
【发布时间】:2018-03-16 05:18:03
【问题描述】:

当控制器出现时,它会显示空白。当我单击另一个选项卡并返回到同一个选项卡时。显示空白。然后工作正常。让我知道如何删除其中的空白。(空白显示在 Buy MB for BTC 上方)

截图:

 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
}

【问题讨论】:

    标签: uiview viewcontroller


    【解决方案1】:

    改变

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

    .selectionIndidcatorColor(UIColor.clear)

    这应该可以解决问题

    【讨论】:

    • 好的,尝试将 .selectionIndicatorHeight(2.0) 更改为 .selectionIndicatorHeight(0)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-17
    • 1970-01-01
    • 2020-08-02
    • 1970-01-01
    • 2017-05-18
    • 2021-12-29
    • 2022-07-05
    相关资源
    最近更新 更多