开发者

Android adding HTML content on a webview without space

开发者 https://www.devze.com 2022-12-29 19:03 出处:网络
I am trying to add an HTML content to a web view. If the words in the HTML content are without spaces then webview keeps that particular word on the same l开发者_Python百科ine.I want that content to b

I am trying to add an HTML content to a web view. If the words in the HTML content are without spaces then webview keeps that particular word on the same l开发者_Python百科ine.I want that content to be wrapped and be on the next line.Is it possible to do that.I am attaching a sample code that can reproduce the issue.

  String temp="<p>WebViewallowsyoutocreateyourownwindowforviewingwebpages(orevendevelopacompletebrowser).Inthistutorial,youcreateasimpleActivitythatcanviewandnavigatewebpages.1.CreateanewprojectnamedHelloWebView.</p>";
             WebView wb=new WebView(this);
             wb.loadDataWithBaseURL("", temp, "text/html", Encoding.UTF_8.toString(),""); 
             setContentView(wb);


Try using proper html tags I think because you used just paragraph it keeps on scrolling horizontally.

0

精彩评论

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