Text View is an UI element that allows users to view and/or modify the displayed text. Use this tag for programming questions related text views, and add the relevant programming language or technology tag to get more exposure for your question. General UX questions regarding where to place a text view, and other similar opinion based questions are not on topic for Stack Overflow.
Questions tagged [textview]
14126 questions
4
votes
3 answers
Android: Cut off to long multiline text in TextView
I have a TextView with a height depending on previous content, but there might be a long Text in it. How can I cut it off at the right point and concatenate three dots or something similar to the new end?
Currently it looks like this:
I found some…

Eknoes
- 508
- 1
- 11
- 24
4
votes
2 answers
Android How does TextView Shadow work
I have textview with shadow to show,I put parameters of Shadow ShadowX and ShadowY and ShadowRadius like in following XML code

user2508815
- 73
- 1
- 1
- 5
4
votes
0 answers
Android:TextView Movement in Vertical direction attached with button click listener
How to move textview in vertical direction when I tap on button?
msgtxt.setOnTouchListener(new OnTouchListener() {
@SuppressLint("ClickableViewAccessibility") public boolean onTouch(View v, MotionEvent event) {
// TODO…

Shubham Yadav
- 41
- 2
4
votes
0 answers
playing cards unicode characters not changing color in android TextView
I got the Unicode of heart and diamond characters from this link and I am struggling to make them appear red in android TextView. Suprisingly same code changes color for hollow heart and diamond but not for solid ones. mycodes are below:

theUturn
- 1,101
- 2
- 12
- 25
4
votes
1 answer
Android: How to do fast scrolling for ScrollView with one TextView like in ListView?
I have to show a log file in a TextView which is within a ScrollView. When the log file is bigger, it is very hard to scroll to the end of the view.
So how can I implement a fast scrolling like in ListView with 'fastScrollEnabled'? ScrollView and…

egmontr
- 249
- 3
- 15
4
votes
3 answers
How to get String from setOnItemSelectedListener method?
I'm new to Android and I'm trying to get a String from spinner. I've made some research but I couldn't find anything useful. Without trying to get String the code is working properly. This is the code which is working:
assert staticSpinner2 !=…

Berat Cevik
- 1,818
- 3
- 22
- 28
4
votes
2 answers
Android TextView EditText New Line Spacing
Anyone know how to get the new paragraph (\n or enter) spacing height for an edit text?
What I'm trying to do:
I would like to draw a line below all the text and make a big editing area like a notepad. At the moment, I'm able to get the line spacing…

Chean Siong
- 61
- 6
4
votes
1 answer
adjustsFontSizeToFitWidth for Android
The iPhone has the method adjustsFontSizeToFitWidth for the UILabel.
Is there a way to automatically adjust the width of the text to match the width TextView or Button in android?

tidwall
- 6,881
- 2
- 36
- 47
4
votes
0 answers
Shared transition animation of TextView with different color from one activity to another
I am using shared transition animation with TextView. I have two activities from where I transits TextView from first activity to second.In first activity text color of TextView is Black and background of whole layout is white.While in second…

AndiM
- 2,196
- 2
- 21
- 38
4
votes
0 answers
Android TextView Focus issue in listview (MarshMallow only)
This issue is on MarshMallow (only)
I am working on an chat application using textview in listview, when I touch/longpress on item of the textview, it gets focus and works fine in Android version 4.2.2 but in MarshMallow it loses focus same time.
I…

Ramesh Kumar
- 1,229
- 14
- 24
4
votes
1 answer
Settext issue in ViewPager particular version - 5.1.1 android?
I am building android application where I am using Custom ViewPager. The Problem is explain below in the following steps:
When I open new activity of ViewPager and click on any button and setText any particular value to it. It's working…

sofquestion 9
- 167
- 4
- 12
4
votes
2 answers
Android Html.fromHtml function auto converts undesired text into hyperlinks
Android Html.fromHtml function auto converts undesired text into hyperlinks.
Here is my code:
String htmlContent= "corners of nail.It has to";
textViewContent.setTextHtml.fromHtml(htmlContent));
…

Rushikesh Talokar
- 1,515
- 4
- 16
- 32
4
votes
0 answers
Draw a character with 2 color in Android
I am trying to achieve a karaoke text animation in a Textview. Something like this:
In order for it to be smooth, I want to find a way to draw a 2-color character(like s in the image).
I found this link but the HalfColorSpan there didn't draw…

Hoang Phan
- 2,146
- 1
- 15
- 16
4
votes
1 answer
CollapsingToolbarLayout: setShadowLayer
I have a collapsingToolbarLayout with the user's name displayed in both the collapsed mode and the expanded mode.
It looks like this when expanded:
It looks like this when half collapsed:
You can see that the white text doesn't work very nicely…

Simon
- 19,658
- 27
- 149
- 217
4
votes
3 answers
Android minLines and maxLines aren't working together in same TextView
Here I have only 1 item in ListView and I'm showing two different TextViews of different colors at the end of the ListView item.
But the issue is I wanna show maximum 3 lines of each TextView but it's not providing me a good result if length of…

Siri
- 143
- 11