All Questions

698
votes
32answers
304363 views

Auto Scale TextView Text to Fit within Bounds

I'm looking for an optimal way to resize wrapping text in a TextView so that it will fit within its getHeight and getWidth bounds. I'm not simply looking for a way to wrap the text- I want to make sur...
489
votes
17answers
232979 views

Is it possible to have multiple styles inside a TextView?

Is it possible to set multiple styles for different pieces of text inside a TextView? For instance, I am setting the text as follows: tv.setText(line1 + "\n" + line2 + "\n" + word1 + "\t" + word2 + ...
579
votes
21answers
429890 views

Making TextView scrollable on Android

I am displaying text in a textview that appears to be too long to fit into one screen. I need to make my TextView scrollable. How can I do that? Here is the code: final TextView tv = new TextView(th...
128
votes
13answers
91717 views

handle textview link click in my android app

I'm currently rendering HTML input in a TextView like so: tv.setText(Html.fromHtml("<a href='test'>test</a>")); The HTML being displayed is provided to me via an external resource, so I...
170
votes
21answers
142427 views

How to adjust text font size to fit textview

Is there any way in android to adjust the textsize in a textview to fit the space it occupies? E.g. I'm using a TableLayout and adding several TextViews to each row. Since I don't want the TextViews ...
306
votes
22answers
345789 views

Android TextView Justify Text

How do you get the text of a TextView to be Justified (with text flush on the left- and right- hand sides)? I found a possible solution here, but it does not work (even if you change vertical-center...
131
votes
7answers
70774 views

How to set the part of the text view is clickable

I have the text "Android is a Software stack". In this text i want to set the "stack" text is clickable. in the sense if you click on that it will redirected to a new activity(not in the browser). I...
90
votes
8answers
62729 views

Vertical (rotated) label in Android

I need 2 ways of showing vertical label in Android: Horizontal label turned 90 degrees counterclockwise (letters on the side) Horizontal label with letters one under the other (like a store sign) ...
253
votes
13answers
386112 views

How to change the font on the TextView?

How to change the font in a TextView, as default it's shown up as Arial? How to change it to Helvetica?
214
votes
10answers
158925 views

android set style in code

I'm trying to use the TextView constructor with style like this: TextView myText = new TextView(MyActivity.this, null, R.style.my_style ); however, when i do this, the text view does not appear to ...

Previous Next