diff --git a/BSModalPickerView/BSModalPickerBase.h b/BSModalPickerView/BSModalPickerBase.h index acefac1..0b70532 100644 --- a/BSModalPickerView/BSModalPickerBase.h +++ b/BSModalPickerView/BSModalPickerBase.h @@ -23,6 +23,9 @@ typedef void (^BSModalPickerViewCallback)(BOOL madeChoice); /* Determines whether to display the opaque backdrop view. By default, this is YES. */ @property (nonatomic) BOOL presentBackdropView; +/* Determine the style of toolbar of PickerView, UIBarStyleDefault is default */ +@property (nonatomic) NSInteger toolBarStyle; + /* Presents the control embedded in the provided view. Arguments: view - The view that will contain the control. diff --git a/BSModalPickerView/BSModalPickerBase.m b/BSModalPickerView/BSModalPickerBase.m index 453008e..16430eb 100644 --- a/BSModalPickerView/BSModalPickerBase.m +++ b/BSModalPickerView/BSModalPickerBase.m @@ -27,6 +27,7 @@ - (id)init { self.autoresizesSubviews = YES; self.presentBackdropView = YES; self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.toolBarStyle = UIBarStyleBlackTranslucent; } return self; } @@ -64,7 +65,7 @@ - (NSArray *)additionalToolbarItems { - (UIToolbar *)toolbar { if (!_toolbar) { _toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, BSMODALPICKER_TOOLBAR_HEIGHT)]; - _toolbar.barStyle = UIBarStyleBlackTranslucent; + _toolbar.barStyle = _toolBarStyle; UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onCancel:)];