Skip to content

Commit 95254be

Browse files
committed
WebView: fixed full size content inset
in some cases, the navigation bar frame isn't yet set correctly in viewWillAppear; => set the inset in viewWillLayoutSubviews instead;
1 parent a430e93 commit 95254be

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

InAppSettingsKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'InAppSettingsKit'
3-
s.version = '3.9.1'
3+
s.version = '3.9.2'
44
s.summary = 'This iPhone framework allows settings to be in-app in addition to being in the Settings app.'
55

66
s.description = <<-DESC

Sources/InAppSettingsKit/Controllers/IASKAppSettingsWebViewController.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,19 @@ - (void)viewWillAppear:(BOOL)animated {
222222
self.webView.underPageBackgroundColor = UIColor.systemBackgroundColor;
223223
}
224224

225+
// Load URL:
226+
[self.webView loadRequest:[NSURLRequest requestWithURL:self.url]];
227+
}
228+
229+
- (void)viewWillLayoutSubviews {
230+
[super viewWillLayoutSubviews];
231+
225232
if (self.fullscreen) {
226233
// Apply a top content inset equal to the nav bar height
227234
CGFloat navBarHeight = CGRectGetMaxY(self.navigationController.navigationBar.frame);
228235
self.webView.scrollView.contentInset = UIEdgeInsetsMake(navBarHeight, 0, 0, 0);
229236
self.webView.scrollView.scrollIndicatorInsets = self.webView.scrollView.contentInset;
230237
}
231-
232-
// Load URL:
233-
[self.webView loadRequest:[NSURLRequest requestWithURL:self.url]];
234238
}
235239

236240

0 commit comments

Comments
 (0)