本文介紹了從 UIWebView 中移除陰影的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我使用 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模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!