我使用 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 中移除阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何通过点击动画 UIImageview 以显示全屏?How to animate a UIImageview to display fullscreen by tapping on it?(如何通过点击动画 UIImageview 以显示全屏?)
iOS 5 故事板,以编程方式确定路径iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以编程方式确定路径)
UIEdgeInsetsMake 是如何工作的?How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
UIProgressView 和自定义跟踪和进度图像(iOS 5 属性UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定义跟踪和进度图像(iOS 5 属性))
语义问题:属性的合成 getter 遵循 Cocoa 命名约定以Semantic Issue: Property#39;s synthesized getter follows Cocoa naming convention for returning #39;owned#39; objects(语义问题:属性的合成 gette
自定义字体在我的应用程序中不起作用?Custom font is not working in my App?(自定义字体在我的应用程序中不起作用?)