How can i add scroll bars to uiwebview. should i put it in uiscrollview. In that case, i'm getting nothing :( Any help will be appreciated.
Thanks.
How can i add scroll bars to uiwebview. should i put it in uiscrollview. In that case, i'm getting nothing :( Any help will be appreciated.
Thanks.
The scrollbars are added automatically when you put content in your UIWebView. Be sure to uncheck "Scales Page to Fit" in Interface builder, so the page is not rescaled when displayed.
UIWebView will automatically display scrollbars when it has content that exceeds the height of the UIView.
Not happening guys. :(
I'm adding the UIWebView in a table cell. But that should not prevent him to add/show UIWebView's scrollbar. And, i'm showing text in UIWebView, not a HTML page. Any ideas?
The problem with adding UIWebView into a table cell is both these objects are scrollable (tableview and webview) which will create complications if not used appropriately. Does you tableview have any cells other than uiwebview? and do you need the tableview to be scrollable? In case the tableview need not be scrollable, make scrolling enabled in the webview and disabled for the tableview. That should work.
But if you want to just display text, why not use a UITextView (though you'll face the same problem for UITextView too)?
My table view does have multiple cells and a header frame as well, and i do need it to be scrollable because it has many rows.
Actually the text displays perfectly fine with UITextView and shows scrollers as well, problem is that my content is rich text, so i don't have any other option but to show the content in UIWebView. Any ideas, hacks?
Unless Apple does something about it, this can't work. Both UITableView and UIWebView support scrollers, and they contradict with each other. UITableView scrollers take precednce so whenever a scroll operation is performed, the action is sent to UITableView instead of UIWebView.
For some reason, when using UITextView with UITableView, scrollers work for both.
You can put a UIWebView into a UIScrollView and have both scrollable by setting the canCancelTouchEvents
property of the UISCrollView to NO
. If you just flick, the UIScrollView will scroll. If you hold your finger down for a short period of time and then start to flick, the UIWebView will scroll.