agiapp / BRPickerView

BRPickerView 封装的是iOS中常用的选择器组件,主要包括:日期选择器(支持年月日、年月等15种日期样式选择,支持设置星期、至今等)、地址选择器(支持省市区、省市、省三种地区选择)、自定义字符串选择器(支持单列、多列、二级联动、三级联动选择)。支持自定义主题样式,适配深色模式,支持将选择器组件添加到指定容器视图。
https://github.com/agiapp/BRPickerView
MIT License
2.57k stars 446 forks source link

Added 'leftButtonIsDoneButton', 'hideLeftBtn' and 'hideRightBtn' properties #88

Closed skuske closed 5 years ago

skuske commented 5 years ago

Added 'leftButtonIsDoneButton', 'hideLeftBtn' and 'hideRightBtn' properties:

1.) 'leftButtonIsDoneButton' makes the left button the 'Done' button, and the right button the 'Cancel' button 2.) 'hideLeftBtn' hides the left button 3.) 'hideRightBtn' hides the right button

:o)

skuske commented 5 years ago

Hiding the two buttons is helpful if you have isAutoSelect set to YES, as then there's no need for the buttons as long as a selection happens.

agiapp commented 5 years ago

This problem has been solved. Please update version 2.3.8. Thanks! :o)

// custom style
BRPickerStyle *customStyle = [[BRPickerStyle alloc]init];
customStyle.doneBtnTitle = @"Ok";
customStyle.doneBtnFrame = CGRectMake(5, 8, 60, 28);
customStyle.doneColor = [UIColor redColor];
//customStyle.hiddenDoneBtn = YES;

customStyle.cancelBtnTitle = @"Custom title";
customStyle.cancelBtnFrame = CGRectMake(SCREEN_WIDTH - 100 - 5, 8, 100, 28);
customStyle.cancelColor = [UIColor blueColor];
//customStyle.hiddenCancelBtn = YES;

stringPickerView.pickerStyle = customStyle;