Created
April 23, 2009 03:24
-
-
Save AlanQuatermain/100277 to your computer and use it in GitHub Desktop.
How to make a UIWebView in a table cell fill the ugly grey bit with rendered data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIWebView (WebViewManualRedrawSupport) | |
- (id) _documentView; | |
@end | |
@interface NSObject (WebViewManualRedrawSupport) | |
- (id) _webCoreNeedsDisplay; | |
@end | |
@implementation MyTableCellContainingAWebView (GetRidOfUglyGreyBlock) | |
- (void) setWebContentNeedsDisplay | |
{ | |
id docView = [_myWebView _documentView]; | |
if ( [docView respondsToSelector: @selector(_webCoreNeedsDisplay)] ) | |
[docView _webCoreNeedsDisplay]; | |
} | |
@end | |
@implementation MyTableViewController (WebViewRedrawingSupport) | |
- (void) scrollViewDidEndDragging: (UIScrollView *) scrollView | |
willDecelerate: (BOOL) willDecelerate | |
{ | |
[contentViewerCell setWebViewNeedsDisplay]; | |
if ( [[self superclass] instancesRespondToSelector: _cmd] ) | |
{ | |
[super scrollViewDidEndDragging: scrollView | |
willDecelerate: willDecelerate]; | |
} | |
} | |
- (void) scrollViewDidEndDecelerating: (UIScrollView *) scrollView | |
{ | |
[contentViewerCell setWebViewNeedsDisplay]; | |
if ( [[self superclass] instancesRespondToSelector: _cmd] ) | |
[super scrollViewDidEndDecelerating: scrollView]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to do this using only documented methods?