开发者

Stopping a UIWebView from scrolling horizontally

开发者 https://www.devze.com 2023-02-07 05:58 出处:网络
I\'ve a UIWebview displaying a .rtf 开发者_开发问答file. The lines of text are wider than the screen.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消