liufengting / FTPopOverMenu

FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use. Supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect.
MIT License
1.04k stars 171 forks source link

能固定整个menu高度吗? #21

Closed hengchengfei closed 7 years ago

hengchengfei commented 7 years ago

menu高度能固定吗,像tableview一样,能上下滑动的?

添加了一个menuShowDefaultRows属性。

// FTConfiguration
public var menuShowDefaultRows:Int = 0

fileprivate func configurePopMenuFrame() {
       //...
        if (arrowDirection == .Up) {
             popMenuFrame = CGRect(x: popMenuOriginX, y: (senderRect.origin.y + senderRect.size.height), width: configuration.menuWidth, height: popMenuHeight)
            if configuration.menuShowDefaultRows > 0 {
                let height = configuration.menuRowHeight * CGFloat(configuration.menuShowDefaultRows) + FTDefaultMenuArrowHeight
                 popMenuFrame = CGRect(x: popMenuOriginX, y: (senderRect.origin.y + senderRect.size.height), width: configuration.menuWidth, height: height)
            } 
        }
    }
liufengting commented 7 years ago

估计要改下源码就可以支持