Skip to content

Commit 5718efb

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

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
@@ -1133,6 +1133,12 @@ - (UIStatusBarStyle)preferredStatusBarStyle
11331133
NSString* statusBarStylePreference = [self settingForKey:@"InAppBrowserStatusBarStyle"];
11341134
if (statusBarStylePreference && [statusBarStylePreference isEqualToString:@"lightcontent"]) {
11351135
return UIStatusBarStyleLightContent;
1136+
} else if (statusBarStylePreference && [statusBarStylePreference isEqualToString:@"darkcontent"]) {
1137+
if (@available(iOS 13.0, *)) {
1138+
return UIStatusBarStyleDarkContent;
1139+
} else {
1140+
return UIStatusBarStyleDefault;
1141+
}
11361142
} else {
11371143
return UIStatusBarStyleDefault;
11381144
}

0 commit comments

Comments
 (0)