每次滚动时,UITableView中的UIWebView都会重新加载.如何防止重新加载? [英] UIWebView in UITableView reloads everytime I scroll. How do I prevent it from reloading?
问题描述
当前,我有一个 UITableView
,在每个 cell
中都有一个 UIWebView
.每个 UIWebView
都加载一个独特的嵌入式YouTube视频.有没有一种方法可以防止滚动时重新加载 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屋!