Giter VIP home page Giter VIP logo

Comments (3)

wwmz avatar wwmz commented on June 6, 2024

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

// 无子目录时,执行确认操作
        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];
        }

你去看美团外卖的demo里面有的 下级分类数量为0的时候
直接调用 [menu closeWith:dropIndexPath row:indexpath.row data:data]; 就可以了

from wmzdropdownmenu.

iT-Boyer avatar iT-Boyer commented on June 6, 2024

嗯,在demo中有WMZDropDownMenu.h开放了closeWith:row:data:方法
我是用的cocoapods集成的,目前版本还不支持,坐等升级下库版本。

from wmzdropdownmenu.

iT-Boyer avatar iT-Boyer commented on June 6, 2024

本地更新了索引pod update,已经拿到最新版本。

from wmzdropdownmenu.

Related Issues (20)

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.