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

Make the property toolbar style public for design propose #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions BSModalPickerView/BSModalPickerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion BSModalPickerView/BSModalPickerBase.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ - (id)init {
self.autoresizesSubviews = YES;
self.presentBackdropView = YES;
self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.toolBarStyle = UIBarStyleBlackTranslucent;
}
return self;
}
Expand Down Expand Up @@ -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:)];
Expand Down