Skip to content

Commit 6b92084

Browse files
NiklasMerztimbru31
andauthored
feat(ios): add InAppBrowserStatusBarStyle 'darkcontent' configuration option (apache#828)
Co-authored-by: Tim Brust <[email protected]>
1 parent 0786260 commit 6b92084

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ simply hook `window.open` during initialization. For example:
7171
### Preferences
7272

7373
#### <b>config.xml</b>
74-
- <b>InAppBrowserStatusBarStyle [iOS only]</b>: (string, options 'lightcontent' or 'default'. Defaults to 'default') set text color style for iOS.
74+
- <b>InAppBrowserStatusBarStyle [iOS only]</b>: (string, options 'lightcontent', 'darkcontent' or 'default'. Defaults to 'default') set text color style for iOS. 'lightcontent' is intended for use on dark backgrounds. 'darkcontent' is only available since iOS 13 and intended for use on light backgrounds.
7575
```
7676
<preference name="InAppBrowserStatusBarStyle" value="lightcontent" />
7777
```

src/ios/CDVWKInAppBrowser.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,12 @@ - (UIStatusBarStyle)preferredStatusBarStyle
10711071
NSString* statusBarStylePreference = [self settingForKey:@"InAppBrowserStatusBarStyle"];
10721072
if (statusBarStylePreference && [statusBarStylePreference isEqualToString:@"lightcontent"]) {
10731073
return UIStatusBarStyleLightContent;
1074+
} else if (statusBarStylePreference && [statusBarStylePreference isEqualToString:@"darkcontent"]) {
1075+
if (@available(iOS 13.0, *)) {
1076+
return UIStatusBarStyleDarkContent;
1077+
} else {
1078+
return UIStatusBarStyleDefault;
1079+
}
10741080
} else {
10751081
return UIStatusBarStyleDefault;
10761082
}

0 commit comments

Comments
 (0)