Skip to content

Commit 4fc32ff

Browse files
committed
Added barsTranslucent property to SVModalWebViewController
fixes TransitApp#116
1 parent 5be38e4 commit 4fc32ff

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

Demo/Classes/ViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ - (void)presentWebViewController {
2424
NSURL *URL = [NSURL URLWithString:@"http://samvermette.com"];
2525
SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithURL:URL];
2626
webViewController.modalPresentationStyle = UIModalPresentationPageSheet;
27+
webViewController.barsTranslucent = NO;
2728
[self presentViewController:webViewController animated:YES completion:NULL];
2829
}
2930

SVWebViewController/SVModalWebViewController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
- (instancetype)initWithURLRequest:(NSURLRequest *)request;
1616

1717
@property (nonatomic, strong) UIColor *barsTintColor;
18+
@property (nonatomic, assign, getter=isBarsTranslucent) BOOL barsTranslucent;
1819

1920
@end

SVWebViewController/SVModalWebViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ - (void)viewWillAppear:(BOOL)animated {
5555

5656
self.webViewController.title = self.title;
5757
self.navigationBar.tintColor = self.barsTintColor;
58+
self.navigationBar.translucent = self.barsTranslucent;
5859
}
5960

6061
@end

SVWebViewController/SVWebViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ - (void)updateToolbarItems {
193193
toolbar.items = items;
194194
toolbar.barStyle = self.navigationController.navigationBar.barStyle;
195195
toolbar.tintColor = self.navigationController.navigationBar.tintColor;
196+
toolbar.translucent = self.navigationController.navigationBar.translucent;
196197
self.navigationItem.rightBarButtonItems = items.reverseObjectEnumerator.allObjects;
197198
}
198199

@@ -211,6 +212,7 @@ - (void)updateToolbarItems {
211212

212213
self.navigationController.toolbar.barStyle = self.navigationController.navigationBar.barStyle;
213214
self.navigationController.toolbar.tintColor = self.navigationController.navigationBar.tintColor;
215+
self.navigationController.toolbar.translucent = self.navigationController.navigationBar.translucent;
214216
self.toolbarItems = items;
215217
}
216218
}

0 commit comments

Comments
 (0)