gpt4 book ai didi

objective-c - 在 UIWebview 中添加了空格 - 在 iOS7 和 iOS8 中删除了 UIWebView 空格

转载 作者:太空狗 更新时间:2023-10-30 03:09:02 25 4
gpt4 key购买 nike

我正在加载本地 html 文件,因为 iOS7 在 UIWebView 的顶部添加了空白。(我无法发布图像,因为我没有足够的点数。) image can be seen here- snap shot from iPhone simulator, uiwebview surrounded by black frame, the html content is grey, but there is white added above it

我尝试使用

调整缩放
[webView stringByEvaluatingJavaScriptFromString:@"document. body.style.zoom = 5.0;"];
webView.scalesPageToFit = NO;

我还设置了尝试删除白色间距:

 NSString *padding = @"document.body.style.margin='0';document.body.style.padding = '0'";
[webView stringByEvaluatingJavaScriptFromString:padding];

仍然没有运气。在桌面 chrome 浏览器中没有空格。 html 文件是 Google Swiffy 文件 - 包含 html 和 JSON。

编辑:updated Image

最佳答案

在 ViewDidLoad 中尝试 self.automaticallyAdjustsScrollViewInsets = NO;

ios 7 自动为 ScrollView 添加 64px。 (状态栏和导航栏)

关于objective-c - 在 UIWebview 中添加了空格 - 在 iOS7 和 iOS8 中删除了 UIWebView 空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18947872/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com