Skip to content

Commit

Permalink
Can change toolbar hidden
Browse files Browse the repository at this point in the history
fixes #2
  • Loading branch information
ykws committed Jan 6, 2015
1 parent 3cc5fd7 commit 63ea535
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions Demo/Classes/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ - (void)presentWebViewController {
webViewController.barsTintColor = [UIColor whiteColor];
webViewController.barsTranslucent = NO;
webViewController.barsStyle = UIBarStyleBlack;
webViewController.toolBarHidden = YES;
[self presentViewController:webViewController animated:YES completion:NULL];
}

Expand Down
1 change: 1 addition & 0 deletions SVWebViewController/SVModalWebViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
@property (nonatomic, strong) UIColor *barsTintColor;
@property (nonatomic, assign, getter=isBarsTranslucent) BOOL barsTranslucent;
@property (nonatomic, assign) UIBarStyle barsStyle;
@property (nonatomic, assign, getter=toolBarHidden) BOOL toolBarHidden;

@end
5 changes: 5 additions & 0 deletions SVWebViewController/SVModalWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@ - (void)setBarsTintColor:(UIColor *)barsTintColor {
self.navigationBar.tintColor = barsTintColor;
}

- (void)setToolBarHidden:(BOOL)toolBarHidden
{
self.webViewController.toolBarHidden = toolBarHidden;
}

@end
2 changes: 2 additions & 0 deletions SVWebViewController/SVWebViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
- (instancetype)initWithURL:(NSURL*)URL;
- (instancetype)initWithURLRequest:(NSURLRequest *)request;

@property (nonatomic, assign, getter=toolBarHidden) BOOL toolBarHidden;

@end
2 changes: 1 addition & 1 deletion SVWebViewController/SVWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
[self.navigationController setToolbarHidden:NO animated:animated];
[self.navigationController setToolbarHidden:self.toolBarHidden animated:animated];
}
else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[self.navigationController setToolbarHidden:YES animated:animated];
Expand Down

0 comments on commit 63ea535

Please sign in to comment.