用本地“加载”填充 UIWebView互联网内容之前的图像

发布于 2024-11-27 02:52:49 字数 214 浏览 1 评论 0原文

我有一个 UITableView ,其标题作为 uiwebview (320*44px) 用于发布内容。我想知道如何在从网络加载内容之前显示一些本地内容图像或背景颜色或其他内容?

目标:消除未加载的 uiwebview 横幅的白色默认背景)

I have a UITableView with header as a uiwebview (320*44px) for pub content. I wonder how to show some local content image or a background color or whatever before the content get loaded from the web ??

(goal: eleminate the white default background for not-loaded uiwebview banner)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萧瑟寒风 2024-12-04 02:52:49
//i assume ur webview object name as webView;

//i assume u were use delegate to ur webview by specifing after creating the webview like

webView.delegate=self;

//dont forget to in .h file @interface urViewController : vijayviewController<UIWebViewDelegate> { <UIWebViewDelegate> is matter.

UIImageView *imageView=[[UIImageView alloc]initWithFrame:webView.bounds];

[imageView setImage:[UIImage imageNamed:@"vijay.png"]];//image size should ur specification 320*44px

[imageView setTag:55];


[webView addSubview:imageView];

[imageView release];


//to remove image

//  [[webView viewWithTag:55] removeFromSuperview];


  - (void)webViewDidFinishLoad:(UIWebView *)webView{



    [[webView viewWithTag:55] removeFromSuperview];

   }
//i assume ur webview object name as webView;

//i assume u were use delegate to ur webview by specifing after creating the webview like

webView.delegate=self;

//dont forget to in .h file @interface urViewController : vijayviewController<UIWebViewDelegate> { <UIWebViewDelegate> is matter.

UIImageView *imageView=[[UIImageView alloc]initWithFrame:webView.bounds];

[imageView setImage:[UIImage imageNamed:@"vijay.png"]];//image size should ur specification 320*44px

[imageView setTag:55];


[webView addSubview:imageView];

[imageView release];


//to remove image

//  [[webView viewWithTag:55] removeFromSuperview];


  - (void)webViewDidFinishLoad:(UIWebView *)webView{



    [[webView viewWithTag:55] removeFromSuperview];

   }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文