Skip to content

最底部是按钮的时候,如果调用[datePickerView show],会自动点击底部的按钮。 #302

@daijuqing

Description

@daijuqing
UIButton *dingButton = [[UIButton alloc]init];
[self.view addSubview:dingButton];
[dingButton mas_makeConstraints:^(MASConstraintMaker *make) {
    make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
    make.left.right.equalTo(self.view);
    make.height.equalTo(@45);
}];
[dingButton setTitle:@"Book Accommodation" forState:UIControlStateNormal];
[dingButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
dingButton.backgroundColor = [UIColor systemRedColor];
[dingButton addTarget:self action:@selector(abcded) forControlEvents:UIControlEventTouchUpInside];

如果设置按钮在最底部,调用show方法选择时间,调用show时,底部按钮会被自动点击。
只有设置不在最底部时候,才不会点击这个按钮,比如设置这个按钮 make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom).offset(-1);
距离底部1像素,也不会调用。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions