开发者

Wordwrap problem in android

I am having a textview with multi line text. In some places textview is having webpage address like google.com yahoo.com etc.., Now because of multi line, wordwrap functionality is splitting google. in one line and com in other line, same is happening f开发者_开发问答or yahoo. in one line and com in other line.

Is there any way to specify that some words in the string should not be splitted in android?

-RR..


you have to load your string as Html content. For Example, think that this your String

Android is a software stack for mobile devices that includes an operating system, middleware and key applications. <a>http://www.google.co.in</a> The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

you have to put <a> tag to doesnot affect the wordwrap.

you have to load your String like this: textview.setText(Html.fromHtml(content_String));

Hope it helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜