Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我创建了一个按钮点击方法方法里面如下,但是点击两下按钮才会输出一次“1”,能不能设置成菜单弹出,收回的时候点击事件都触发 #5

Open
ZachGuoMingyu opened this issue Jan 11, 2019 · 3 comments

Comments

@ZachGuoMingyu
Copy link

  • (void)viewDidLoad {

    [super viewDidLoad];
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(100, 700, 60, 30)];
    [btn setBackgroundColor:[UIColor blueColor]];
    [btn addTarget:self action:@selector(clickItem) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"筛选" style:UIBarButtonItemStylePlain target:self action:@selector(clickItem)];
    }

  • (void)clickItem {
    NSLog(@"1");
    GHDropMenuModel *configuration = [[GHDropMenuModel alloc]init];

    configuration.titles = [configuration creaFilterDropMenuData];
    /** 配置筛选菜单是否记录用户选中 默认NO */
    configuration.recordSeleted = NO;

    weakself(self);
    GHDropMenu *dropMenu = [GHDropMenu creatDropFilterMenuWidthConfiguration:configuration dropMenuTagArrayBlock:^(NSArray * _Nonnull tagArray) {
    [weakSelf getStrWith:tagArray];

    }];
    dropMenu.titleSeletedImageName = @"up_normal";
    dropMenu.titleNormalImageName = @"down_normal";
    dropMenu.delegate = self;
    dropMenu.durationTime = 0.5;
    self.dropMenu = dropMenu;
    [dropMenu show];

}

@shabake
Copy link
Owner

shabake commented Jan 15, 2019

正常来说你每次点击button都会响应
1.查看你的button响应事件
2.configuration.titles = [configuration creaFilterDropMenuData]; 你选择构造这种模型是侧边弹出的菜单,只有点击的时候可以弹出,弹出后button是被覆盖在蒙版后面的,是点不到的

@ZachGuoMingyu
Copy link
Author

正常来说你每次点击button都会响应
1.查看你的button响应事件
2.configuration.titles = [configuration creaFilterDropMenuData]; 你选择构造这种模型是侧边弹出的菜单,只有点击的时候可以弹出,弹出后button是被覆盖在蒙版后面的,是点不到的

那怎么才能在button的点击事件里获取到筛选菜单收回的方法?

@ZachGuoMingyu
Copy link
Author

正常来说你每次点击button都会响应
1.查看你的button响应事件
2.configuration.titles = [configuration creaFilterDropMenuData]; 你选择构造这种模型是侧边弹出的菜单,只有点击的时候可以弹出,弹出后button是被覆盖在蒙版后面的,是点不到的

能否在外部也能调用dismiss方法,我尝试了一下没有效果,点击不能收回

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants