每次滚动时,UITableView中的UIWebView都会重新加载.如何防止重新加载? [英] UIWebView in UITableView reloads everytime I scroll. How do I prevent it from reloading?

查看:61
本文介绍了每次滚动时,UITableView中的UIWebView都会重新加载.如何防止重新加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我有一个 UITableView ,在每个 cell 中都有一个 UIWebView .每个 UIWebView 都加载一个独特的嵌入式YouTube视频.有没有一种方法可以防止滚动时重新加载 UIWebView .当它在屏幕上滚动时,它看起来便宜一些,并且是一个白色矩形,用于加载视频缩略图.我一直在研究 UIWebView 缓存,但不知道如何缓存 WebView 以便以后再使用.

Currently I have a UITableView that has a UIWebView in every cell. Each UIWebView is loading a unique embedded YouTube video. Is there a way to keep the UIWebView from reloading when scrolling. It looks cheaply developed when it scrolls on screen and is a white rectangle to loading a video thumbnail. I was looking into UIWebView caching but I don't know how I would go about caching the WebView to reuse it later.

推荐答案

您可以尝试不同的方法,只需为该特定索引定义新的表格视图单元格即可,例如

You can try this differently, just define new table view cell for that particular index like

UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nil] retain];

看看这是否能满足您的需求

see if that makes a difference you desire

这篇关于每次滚动时,UITableView中的UIWebView都会重新加载.如何防止重新加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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