Skip to content

Commit 043f96a

Browse files
authored
Merge pull request apache#765 from mrbberra/master
(ios) Add InAppBrowserStatusBarStyle preference. Resolves apache#728
2 parents b7ea751 + edd7250 commit 043f96a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ simply hook `window.open` during initialization. For example:
6868
window.open = cordova.InAppBrowser.open;
6969
}
7070

71+
### Preferences
72+
73+
#### <b>config.xml</b>
74+
- <b>InAppBrowserStatusBarStyle [iOS only]</b>: (string, options 'lightcontent' or 'default'. Defaults to 'default') set text color style for iOS.
75+
```
76+
<preference name="InAppBrowserStatusBarStyle" value="lightcontent" />
77+
```
78+
7179
## cordova.InAppBrowser.open
7280

7381
Opens a URL in a new `InAppBrowser` instance, the current browser

src/ios/CDVWKInAppBrowser.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,12 @@ - (void)viewDidDisappear:(BOOL)animated
10551055

10561056
- (UIStatusBarStyle)preferredStatusBarStyle
10571057
{
1058-
return UIStatusBarStyleDefault;
1058+
NSString* statusBarStylePreference = [self settingForKey:@"InAppBrowserStatusBarStyle"];
1059+
if (statusBarStylePreference && [statusBarStylePreference isEqualToString:@"lightcontent"]) {
1060+
return UIStatusBarStyleLightContent;
1061+
} else {
1062+
return UIStatusBarStyleDefault;
1063+
}
10591064
}
10601065

10611066
- (BOOL)prefersStatusBarHidden {

0 commit comments

Comments
 (0)