I have googled quite a bit and I can't seem to find anything that makes sense to me. I need to center the contents of a webview both vertically and horizontally. I have been able to get the horizontal to work with this:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSString *bodyStyle = @"document.getElementsByTagName('body')[0].style.textAlign = 'center';";
[self.webView stringByEvaluatingJavaScriptFromString:bodyStyle];
}
But I can't find anything on vertical. Any ideas? Any help would be appreciated.