I have a UIWebView linking to a mobile Twitter page and it shows this bar at the top. I'm wanting to remove it so it won't limit viewing space but not having any luck. I have attempted to pass javascript to the page after loading to hide it but it doesn't work.
I'm using the example here:
And
I've also tried it with getElementByClassName and getElementByTagName and none work. Any ideas?
I'm using the example here:
Code:
- (void)hideUnwantedHTML{
[self.webView stringByEvaluatingJavaScriptFromString:@"var script = document.createElement('script');"
"script.type = 'text/javascript';"
"script.text = \"function hideID(idName) { "
"var id = document.getElementById(idName);"
"id.style.display = 'none';"
"}\";"
"document.getElementsByTagName('head')[0].appendChild(script);"];
[self.webView stringByEvaluatingJavaScriptFromString:@"hideID('brand_bar');"];
}
And
Code:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[self hideUnwantedHTML];
}
I've also tried it with getElementByClassName and getElementByTagName and none work. Any ideas?