Removing shadows from UIWebView(从 UIWebView 中移除阴影)
问题描述
我使用 web 视图来显示小的 pdf 文件.为了美观,我想删除 PDF 周围的灰色边框.有什么办法吗?我查看了各种资源,这些资源似乎都不起作用,或者解决方案在 iOS5 中不再起作用.
I use a web view to display small pdf files. In the interest of aesthetics, I'd like to remove the grey border around the PDF. Is there any way around it? I've looked at various resources none of which seem to work or the solution no longer works in iOS5.
另外,如果只有一页,有没有办法停止滚动?
Also, is there any way of stopping the scroll if there's only one page?
谢谢.
推荐答案
阴影实际上是 UIScrollView 的 UIImageView 子视图(或 iOS5 UIWebView 中的等价物).
The shadows are actually UIImageView subviews of the UIScrollView (or the equivalent in iOS5 UIWebView).
所以在 iOS4 中:
So in iOS4:
for (UIView* subView in [webView subviews])
{
if ([subView isKindOfClass:[UIScrollView class]]) {
for (UIView* shadowView in [subView subviews])
{
if ([shadowView isKindOfClass:[UIImageView class]]) {
[shadowView setHidden:YES];
}
}
}
}
iOS5 及以上版本:
and in iOS5 and above:
for (UIView* shadowView in [webView.scrollView subviews])
{
if ([shadowView isKindOfClass:[UIImageView class]]) {
[shadowView setHidden:YES];
}
}
这篇关于从 UIWebView 中移除阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 UIWebView 中移除阴影
基础教程推荐
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
