Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uiwebview wrap problem with long words

i have a webview in my application and it works fine. it fits horizontolly (not scrolls) and scrolls vertically. but any word which is longer than 320 pixel makes it scrolls horizantally and makes the font larger. i don't would like horizontal scroll. i would like it to be continued in new line. how can i do?

thanks.

like image 324
ysnky Avatar asked Nov 25 '10 20:11

ysnky


1 Answers

The problem you have is actually not related to the UIWebView in itself. What the web view does is just display any html you provide. This means that you have to format the html to do as you want. One way to accomplish that is to use a div as follows.

<div style="width: 320px; word-wrap: break-word">
text with looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongword goes here
</div>

Caveat: I don't know very much about html and css so there might be better ways of accomplishing this.

like image 52
Robert Höglund Avatar answered Oct 13 '22 02:10

Robert Höglund