Giter VIP home page Giter VIP logo

wwmz / wmzdropdownmenu Goto Github PK

View Code? Open in Web Editor NEW
715.0 6.0 98.0 6.17 MB

🌹一个能几乎实现所有App各种类型筛选菜单的控件,可悬浮,目前已实现闲鱼/美团/Boss直聘/京东/饿了么/淘宝/拼多多/赶集网/美图外卖等等的筛选菜单,可以自由调用代理实现自己想组装的筛选功能和UI,且控件的生命周期自动管理,悬浮自动管理🌹(A control that can implement almost all types of filtering menus of all apps)

License: MIT License

Objective-C 99.73% Ruby 0.27%
menu dropmenu allmenu custom custommenu

wmzdropdownmenu's Introduction

Hi there 👋 I'm WMZ

广州开发

Anurag's github stats

wmzdropdownmenu's People

Contributors

wwmz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wmzdropdownmenu's Issues

您好

我发现,放在tableViewHeader上时,下拉菜单只会显示在状态栏下方,而不是在tableViewHeader下方

MenuUICollectionView样式点击立即关闭

MenuUICollectionView样式默认点击之后还要点确定才会关闭,现在我想去掉确定和重置实现点击立即关闭。但是我配置closeWithTapAtDropIndexPath后,发现MenuUICollectionView变成多选了,怎样才能让它单选呢

更新菜单的内容,高度没有变化。

treeArr根据条件变更,元素数不同。调用如下更新方式,无法根据不同的内容更新菜单的高度。

[self.menu updateData:treeArr AtDropIndexPathSection:section AtDropIndexPathRow:0];

请教下,使用什么方式可以同时适配高度?

动态筛选

我的需求点击优惠活动来更新商家服务这个一栏的数据 ,可以实现吗?

Jietu20191205-222818

收起动画失效

A->B->C,B页面集成,当跳转到C页面再返回B页面的时候,hide动画消失

如何取消最后一个菜单默认是侧边样式?

- (NSArray*)titleArrInMenu:(WMZDropDownMenu *)menu{
    return @[
        @{@"name":@"全部"},
        @"区域",   //取消默认图片
        @{@"name":@"商圈"},
    ];
}

商圈是tableview三级联动样式,一旦放在最后,样式就变成了侧边栏过滤器的效果。

WMZDropMenuBtn 的line颜色的设置

如果想设置WMZDropMenuBtn line的颜色,如何修改呢?如果在标题点击的代理方法
- (void)menu:(WMZDropDownMenu *)menu didSelectTitleInSection:(NSInteger)section btn:(WMZDropMenuBtn *)selectBtn

里面设置的话,不会有效果,因为我看到执行完代理之后,调用了 showLine,然后line的颜色又被改回去了

另外 showLine 传了一个config,demo里config都是穿空?

//点击代理
    if (self.delegate && [self.delegate respondsToSelector:@selector(menu:didSelectTitleInSection:btn:)]) {
        [self.delegate menu:self didSelectTitleInSection:sender.tag-1000 btn:sender];
    }
    
    if ([self.selectTitleBtn isSelected]&&self.param.wMenuLine) {
        [self.selectTitleBtn showLine:@{}];
    }else{
        [self.selectTitleBtn hidenLine];
    }

不知道是不是应该用另外一个返回按钮的代理方法

- (NSDictionary*)menu:(WMZDropDownMenu *)menu customTitleInSection:(NSInteger)section withTitleBtn:(WMZDropMenuBtn*)menuBtn

但是这里返回的dictioary,请问应该是如何返回?demo没有找到如何使用,这个代理应该是只修改按钮也无法修改line

协议方法兼容swift

协议方法需要返回nil的情况下,建议加上nullable关键字,桥接成swift才能支持返回可选nil,否则会报错,解决如下
image
image

点击头部会重置

github00007
先选择红色区域,头部标题会更改并收起,再次选择蓝色区域,再点击绿色区域,左侧弹框会重置!

顺便再说一下,后面再更新版本能添加个弹框收起时的代理 或者通知吗?

图片模糊

下拉的小三角和箭头图片都很模糊。

同一菜单下,多个层级时,最后一级单选样式无效的问题

我按照闲鱼demo实现了三级联动的菜单,设置的是MenuEditOneCheck的单选样式
当在选中三级A时,会在在tree对象中记录isSelected=true,
这时直接去切换其他二级菜单选中三级B,这时三级AisSelected依然为true

这样在UI上,在不同的二级下的三级的样式为多选样式了。

我目前实现一种方式,但是不够理想:

在选中三级B关闭菜单时,会记录下三级B的ID
再次进入菜单时,每次点击tree都会根据上一次记录的选中对象的ID,来重置下级的选中状态,让后手动更新下级内容。

Aspects冲突

我的项目中引用的有Aspects框架,引入了WMZDropDownMenu后编译报错,查看后得知你在WMZDropDownMenu中手动导入了Aspects 的文件,最终我的项目中Aspects 相关的文件重复,建议不要在开源的项目中手动导入其他开源项目的文件,否则一旦有开发人员同时引入这两个开源项目就会报错,并且还很尴尬,只能选择性手动引入其中一个才能解决

在多级列表中,如何在点击没有子级的菜单时,触发关闭下拉框。

研究了大神的代码,过程中遇到的两个问题,通过深挖源码,勉强解决了。

// 无子目录时,执行确认操作
        if (vmm.children.count == 0) {
            if ([menu respondsToSelector:@selector(confirmAction:)]) {
                [menu performSelector:@selector(confirmAction:) withObject:[UIButton new]]; //问题1
                [menu changeTitleConfig:@{@"name":vmm.name} withBtn:menu.selectTitleBtn];//问题2
            }
        }

暂时使用confirmAction:方法来实现。
遇到的两个问题:

  1. 在头文件中没有开放出来的-(void)confirmAction:(id)sender确认方法.
  2. 在上下推出下拉框样式中,强制使用confirmAction:方法关闭,导致标签显示为多选
    暂时通过调用:changeTitleConfig: withBtn:方法同步了选中的内容。
if ([self getTitleFirstDropWthTitleBtn:self.selectTitleBtn].showAnimalStyle == MenuShowAnimalLeft||
            [self getTitleFirstDropWthTitleBtn:self.selectTitleBtn].showAnimalStyle == MenuShowAnimalRight) {
            [self changeTitleConfig:@{@"name":self.selectTitleBtn.titleLabel.text} withBtn:self.selectTitleBtn];
        }else{
            WMZDropTree *tree = self.selectArr[0];
            [self changeTitleConfig:@{@"name":self.selectArr.count>1?@"多选":
                                          (tree.name?:self.selectTitleBtn.titleLabel.text)} withBtn:self.selectTitleBtn];
        }

请问下我需要拿着 key 和 value 绑定

请问下我需要拿着 key(需要展示出来的数据) 和 value(点击之后 得到的值 ) 绑定
我尝试 传入 ID 这样 取不到值. 请问是有什么固定格式或者参数吗

pod install 报错

报错信息CocoaPods could not find compatible versions for pod "WMZDropDownMenu":
In Podfile:
WMZDropDownMenu (~> 1.2.0)
None of your spec sources contain a spec satisfying the dependency: WMZDropDownMenu (~> 1.2.0).

宽度变短

更新数据调用updateUI,使得titlescrollview的宽度变短

缺少定义标题的方法

比如我要清空之前的选项,我选中我定义的“不限”做为清空,但我不想标题显示“不限”,我要另一外名称比如“价格”,我想要换掉

嵌套问题

筛选菜单作为CollectionView的头部, 而CollectionView又嵌套在UITableView中, 那代理中的inScrollView应该 传CollectionView还是UITableView ?

我分别都试过了,都不行,都是从屏幕顶部弹出来。

下拉菜单起点位置的问题

你好,我发现如果视图控制器里有如下代码
self.edgesForExtendedLayout = UIRectEdgeNone;

然后设置
WMZDropDownMenu *menu = [[WMZDropDownMenu alloc] initWithFrame:CGRectMake(0, 0, Menu_Width, 40) withParam:param];

点击出现下拉菜单的时候,会以屏幕顶端作为起点往下滑出

砖研了两天,无奈弃用

1我的导航栏是不透明的,这个时候,筛选菜单原点y值写0或一个导航栏高度,都不对。
2筛选菜单数据不支持后面加载,有哪些选项我这边是通过网络请求返回的。
3数据耦合性太高了,这个我觉得这个可以放开,要展示什么数据是应该用的人自己决定。只要提供位置,和设置数据的接口就好了。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.