I load local data inside a UIWebView. That instance of UIWebView is added to a UITableViewCell as a subview inside method
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
with the following snippet:
[myCell addSubview:aWebView];
The filled webview’s height is larger than the cell’s height, so that the webview should be scrollable inside the cell. Actually this works on iOS 4.1 device and on iOS 3.2 simulator sucessfully. But going back to a iOS 3.1.3 device gets the webview fixed and unscrollable. Does anyone have a hint how to solve this for backwards compatibilty reasons?
First I thought aWebView didn’t receive touch events and therefor it would not scroll. After approaches as
and
I realized that aWebView was responsive. It just didn’t scroll in iOS 3.1.3. Adding aWebView to a UIScrollView instance, which was added as a subview to the cell’s contentView, made the web view scrollable in both, iOS 3.x and iOS 4.x.
The above code snippet basically does it. Don’t forget to set scrollview’s content size again, after the webview finished loading content. OS fragmentation is naughty.