wwmz/WMZDropDownMenu

链式语法

sunchengbo opened this issue · 6 comments

在Swift中如何书写格式

wwmz commented

在Swift中如何书写格式
诸如此类 然后有block就用block就行
let param:WMZDropMenuParam = MenuParam()
param.wMainRadius = 0
param.wMaxWidthScale = 0.8

Swift中在设置WMZDropMenuParam时,使用.wReginerCollectionCellsSet()(["itemCell"])无法注册cell

Thread 1: Exception: "could not dequeue a view of kind: UICollectionElementKindCell with identifier itemCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard"

下面是我初始化的代码:

var para = MenuParam()
.wBorderUpDownShowSet()(true)
.wCollectionViewCellSpaceSet()(10)
.wCollectionViewCellBgColorSet()(.purple)
.wCollectionViewCellTitleColorSet()(.black)
.wCollectionViewCellSelectBgColorSet()(.black)
.wCollectionViewCellSelectTitleColorSet()(.blue)
.wCollectionViewSectionShowExpandCountSet()(9)
.wMenuTitleEqualCountSet()(3)
.wReginerCollectionCellsSet()([itemCell.self])
.wPopViewWidthSet()(200)
.wShadowAlphaSet()(0.5)
.wShadowColorSet()(.darkGray)
.wShadowCanTapSet()(true)
.wShadowShowSet()(true)

    let menu = WMZDropDownMenu(frame: CGRect(x: 0, y: naviHeight + statusHeight!, width: screenWidth, height: 60), with: para)
    menu.delegate = self
wwmz commented

下面是我初始化的代码:

var para = MenuParam()
.wBorderUpDownShowSet()(true)
.wCollectionViewCellSpaceSet()(10)
.wCollectionViewCellBgColorSet()(.purple)
.wCollectionViewCellTitleColorSet()(.black)
.wCollectionViewCellSelectBgColorSet()(.black)
.wCollectionViewCellSelectTitleColorSet()(.blue)
.wCollectionViewSectionShowExpandCountSet()(9)
.wMenuTitleEqualCountSet()(3)
.wReginerCollectionCellsSet()([itemCell.self])
.wPopViewWidthSet()(200)
.wShadowAlphaSet()(0.5)
.wShadowColorSet()(.darkGray)
.wShadowCanTapSet()(true)
.wShadowShowSet()(true)

    let menu = WMZDropDownMenu(frame: CGRect(x: 0, y: naviHeight + statusHeight!, width: screenWidth, height: 60), with: para)
    menu.delegate = self

你注册的cell要和你的cell类名一模一样才可以哦 你这个itemCell应该不是你的cell类名吧

下面是我初始化的代码:
var para = MenuParam()
.wBorderUpDownShowSet()(true)
.wCollectionViewCellSpaceSet()(10)
.wCollectionViewCellBgColorSet()(.purple)
.wCollectionViewCellTitleColorSet()(.black)
.wCollectionViewCellSelectBgColorSet()(.black)
.wCollectionViewCellSelectTitleColorSet()(.blue)
.wCollectionViewSectionShowExpandCountSet()(9)
.wMenuTitleEqualCountSet()(3)
.wReginerCollectionCellsSet()([itemCell.self])
.wPopViewWidthSet()(200)
.wShadowAlphaSet()(0.5)
.wShadowColorSet()(.darkGray)
.wShadowCanTapSet()(true)
.wShadowShowSet()(true)

    let menu = WMZDropDownMenu(frame: CGRect(x: 0, y: naviHeight + statusHeight!, width: screenWidth, height: 60), with: para)
    menu.delegate = self

你注册的cell要和你的cell类名一模一样才可以哦 你这个itemCell应该不是你的cell类名吧

是类名,让人头大

wwmz commented

下面是我初始化的代码:
var para = MenuParam()
.wBorderUpDownShowSet()(true)
.wCollectionViewCellSpaceSet()(10)
.wCollectionViewCellBgColorSet()(.purple)
.wCollectionViewCellTitleColorSet()(.black)
.wCollectionViewCellSelectBgColorSet()(.black)
.wCollectionViewCellSelectTitleColorSet()(.blue)
.wCollectionViewSectionShowExpandCountSet()(9)
.wMenuTitleEqualCountSet()(3)
.wReginerCollectionCellsSet()([itemCell.self])
.wPopViewWidthSet()(200)
.wShadowAlphaSet()(0.5)
.wShadowColorSet()(.darkGray)
.wShadowCanTapSet()(true)
.wShadowShowSet()(true)

    let menu = WMZDropDownMenu(frame: CGRect(x: 0, y: naviHeight + statusHeight!, width: screenWidth, height: 60), with: para)
    menu.delegate = self

你注册的cell要和你的cell类名一模一样才可以哦 你这个itemCell应该不是你的cell类名吧

是类名,让人头大

不是这样的是个类名字符串数组 这样 ["itemCell"]