UIWebView inside UITableView scroll? - iphone

I have UIWebView inside each UITableView cell.
My UIWebView is simple, it contains only two lines, one is bold, and one is regular.
Everything is working fine, except UIWebView is only loading HTML string when scrolling is stopped, it isn't loading while scrolling UITableView.
How can I fix it?

Important: You should not embed
UIWebView or UITableView objects in
UIScrollView objects. If you do so,
unexpected behavior can result because
touch events for the two objects can
be mixed up and wrongly handled.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html
And a UITableView is part of a UIScrollView ;)
Can't you get data as a webservice (json or xml) and add UILabel into your tableview ?
Seems to be easier ?

You can create a custom Cell dynamically and attach external/dynamic data to the UILabels.

Related

uiTableView in Uiscrollview

I wanted to have a tableview which i should be able to scroll horizontally.So i thought of adding a tableview in uiscrollview and then populating the custom cells in it.
Is it the correct way to do it.I have checked on developer site and it is stated that You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled.
Does anyone has implemented such thing.And can anyone help please?

prevent tableview from scrolling while scrolling inside a tableviewcell

i've got a tableview. inside this, i have a tableviewcell with a horizontal scrollview inside it.
it works fine, but if i start scrolling horizontal inside a tableviewcell and move a bit up or down, the horizontal scrolling stops and the tableview gets scrolled.
is there a way to prevent the tableview from scrolling while scrolling horizontal inside a tableviewcell?
thanks for all help
try scrollView.canCancelContentTouches = NO
If that doesn't work you may have to do more complicated handling of touch events by subclassing UIScrollView. (Look at touchesBegan:event:, touchesMoved:event:, touchesEnded:event:, touchesCancelled:event:)
you should not put the UIScrollView inside an UITableView. you could show the content of your cell vertically Or show on the details view
UITableView is a subclass of UIScrollView.
Form Apple Documentation.
Important: You should not embed
UIWebView or UITableView objects in
UIScrollView objects. If you do so,
unexpected behavior can result because
touch events for the two objects can
be mixed up and wrongly handled.
More

How to load images in UIScrollView asynchronously?

HI,
I am getting my images using JSON and I need to display image at a time when my app is running so please tell me how to use asynchronous method to load the images into the UIScrollView?
Thanks.
whether you use a UITableView or a UIScrollView, you will use the same pattern, its just that you have a bit more plumbing to do with the UIScrollView. I would say use the UITableView unless you want to roll your own multi-column image thumbnail picker.
With the UIScrollView, you will need to create your own virtual rows and columns and detect when the ScrollView has scrolled a new row or a new column into view. You will need to queue (remove) the images that have scrolled out of view, and then load the images that have come into view. All in all, this is not trivial code.
The UITableView does all this for you (rows only, no concept of columns)
Having said that.. here is a reference to using the NSOperation class to lazy load your images into a UITableView while giving the user a smooth experience..
UIImage in uitableViewcell slowdowns scrolling table

Two resizable UIWebViews inside UIScrollView

I need following view structure, with embedded 2 UIWebViews and 1 UIView (loaded from other xib).
But the problem is, because this need to be inside UIScrollView, with same impression like this is single page. (only vertical scrolling need to be enabled).
In those UIWebViews, html content is loaded from NSString.
Size (height) of UIWebViews and child view is variable.
Any advice, how to do that?
Important: You should not embed
UIWebView or UITableView objects in
UIScrollView objects. If you do so,
unexpected behavior can result because
touch events for the two objects can
be mixed up and wrongly handled.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html
However why cant you make a webview that has two iframes, with the content of your two html-files? Then attach this webview to the uiview?
Iframe resource:
http://www.w3schools.com/tags/tag_iframe.asp

UIWebViews in UITableView do not render while the table is being scrolled

I have a UITableView with UIWebViews within the cells for the purpose of displaying rich text. The UITableViews load html strings locally. However, when the table is being scrolled, the UIWebViews do not load the html strings specified in "cellForRow..." until the UITableView stops scrolling. Is there any way to override this behaviour so that the UIWebViews load content even when the tableview is scrolling?
It seems that this is not possible at this time for performance reasons. The best way to work around this issue is to render any downloaded content directly onto a UIView by overriding drawRect.