从UIWebView中删除阴影 [英] Removing shadows from UIWebView

查看:401
本文介绍了从UIWebView中删除阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用网络视图来显示小的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中:

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中删除阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆