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

feat(ios): add InAppBrowserStatusBarStyle 'darkcontent' configuration option #828

Merged
merged 3 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ simply hook `window.open` during initialization. For example:
### Preferences

#### <b>config.xml</b>
- <b>InAppBrowserStatusBarStyle [iOS only]</b>: (string, options 'lightcontent' or 'default'. Defaults to 'default') set text color style for iOS.
- <b>InAppBrowserStatusBarStyle [iOS only]</b>: (string, options 'lightcontent', 'darkcontent' or 'default'. Defaults to 'default') set text color style for iOS.
timbru31 marked this conversation as resolved.
Show resolved Hide resolved
```
<preference name="InAppBrowserStatusBarStyle" value="lightcontent" />
```
Expand Down
6 changes: 6 additions & 0 deletions src/ios/CDVWKInAppBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,12 @@ - (UIStatusBarStyle)preferredStatusBarStyle
NSString* statusBarStylePreference = [self settingForKey:@"InAppBrowserStatusBarStyle"];
if (statusBarStylePreference && [statusBarStylePreference isEqualToString:@"lightcontent"]) {
return UIStatusBarStyleLightContent;
} else if (statusBarStylePreference && [statusBarStylePreference isEqualToString:@"darkcontent"]) {
if (@available(iOS 13.0, *)) {
return UIStatusBarStyleDarkContent;
NiklasMerz marked this conversation as resolved.
Show resolved Hide resolved
} else {
return UIStatusBarStyleDefault;
}
} else {
return UIStatusBarStyleDefault;
}
Expand Down