Stopping a UIWebView from scrolling horizontally
I've a UIWebview displaying a .rtf 开发者_开发问答file. The lines of text are wider than the screen.
1) Is there a way to get the text to wrap around rather than going off the edge of the screen and requiring the user to scroll.
2) Is there a way to disable horizontal scrolling in the UIWebView.
Many Thanks Code
If you want the content to fit inside the view, set it's scalesPagesToFit
property to true:
webView.scalesPagesToFit = YES;
If you do that, the pages shouldn't be horizontally scrollable. If they are, you can fiddle around with the stuff in UIScrollView Reference because UIWebView is a subclass of it.
精彩评论