Added whitespace in UIWebview - removing UIWebView whitespace in iOS7 amp; iOS8(在 UIWebview 中添加了空格 - 在 iOS7 amp; 中删除 UIWebView 空格iOS8)
问题描述
我正在加载本地 html 文件,因为 iOS7 在 UIWebView 的顶部添加了空白.(我无法发布图像,因为我没有足够的积分.)图片可以在这里看到 - 从 iPhone 模拟器快照,uiwebview被黑框包围,html内容是灰色的,但是上面加了白色
Im loading local html files, since iOS7 there is added white space on top in the UIWebView.(I cant post an image as i do not have enough points.) 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;
- 感谢:Srikar Appal一个>
我还设置了尝试去除空白:
I also set tried to remove white spacing:
NSString *padding = @"document.body.style.margin='0';document.body.style.padding = '0'";
[webView stringByEvaluatingJavaScriptFromString:padding];
- 感谢:thenextmillionaire
仍然没有运气.在桌面 chrome 浏览器中没有空格.html 文件是 Google Swiffy 文件 - 包含 html 和 JSON.
still no luck. In the desktop chrome browser there is no whitespace. The html files are Google Swiffy files - containing html and JSON.
更新图片
推荐答案
在 ViewDidLoad 中尝试 self.automaticallyAdjustsScrollViewInsets = NO;.
Try self.automaticallyAdjustsScrollViewInsets = NO; in ViewDidLoad.
ios 7 自动为滚动视图添加 64px.(状态栏和导航栏)
ios 7 add 64px automatically for scroll view. (status bar and nav bar)
这篇关于在 UIWebview 中添加了空格 - 在 iOS7 & 中删除 UIWebView 空格iOS8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 UIWebview 中添加了空格 - 在 iOS7 & 中删除 UIWebView 空格iOS8
基础教程推荐
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
