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

Added statusBarStyle property #23

Open
wants to merge 1 commit 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 TSMiniWebBrowser/TSMiniWebBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ typedef enum {
BOOL showReloadButton;
BOOL showActionButton;
UIBarStyle barStyle;
UIStatusBarStyle statusBarStyle;
UIColor *barTintColor;
NSString *modalDismissButtonTitle;
NSString *forcedTitleBarText;

// State control
UIBarStyle originalBarStyle;
UIStatusBarStyle originalStatusBarStyle;
}

@property (assign) id<TSMiniWebBrowserDelegate> delegate;
Expand All @@ -74,6 +76,7 @@ typedef enum {
@property (nonatomic, assign) BOOL showReloadButton;
@property (nonatomic, assign) BOOL showActionButton;
@property (nonatomic, assign) UIBarStyle barStyle;
@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;
@property (nonatomic, strong) UIColor *barTintColor;
@property (nonatomic, strong) NSString *modalDismissButtonTitle;
@property (nonatomic, strong) NSString *domainLockList;
Expand Down
8 changes: 6 additions & 2 deletions TSMiniWebBrowser/TSMiniWebBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ @implementation TSMiniWebBrowser
@synthesize showReloadButton;
@synthesize showActionButton;
@synthesize barStyle;
@synthesize statusBarStyle;
@synthesize modalDismissButtonTitle;
@synthesize barTintColor;
@synthesize domainLockList;
Expand Down Expand Up @@ -214,6 +215,7 @@ - (id)initWithUrl:(NSURL*)url {
modalDismissButtonTitle = NSLocalizedString(@"Done", nil);
forcedTitleBarText = nil;
barStyle = UIBarStyleDefault;
statusBarStyle = UIStatusBarStyleBlackOpaque;
barTintColor = nil;
}

Expand Down Expand Up @@ -241,6 +243,8 @@ - (void)viewDidLoad
originalBarStyle = self.navigationController.navigationBar.barStyle;
}

originalStatusBarStyle = [[UIApplication sharedApplication] statusBarStyle];

// Init tool bar
[self initToolBar];

Expand All @@ -253,7 +257,7 @@ - (void)viewDidLoad
}

// Status bar style
[[UIApplication sharedApplication] setStatusBarStyle:barStyle animated:YES];
[[UIApplication sharedApplication] setStatusBarStyle:statusBarStyle animated:YES];

// UI state
buttonGoBack.enabled = NO;
Expand Down Expand Up @@ -292,7 +296,7 @@ -(void) viewWillDisappear:(BOOL)animated {
}

// Restore Status bar style
[[UIApplication sharedApplication] setStatusBarStyle:originalBarStyle animated:NO];
[[UIApplication sharedApplication] setStatusBarStyle:originalStatusBarStyle animated:NO];

// Stop loading
[webView stopLoading];
Expand Down