I want the TextView to end in one Line…how to do it

i am developing an app, i would have linked an image but i don't have enough reputation to do so....my problem is The text doesn't fit in one line it goes to the second line,obviously thats because i have set the height to "wrap_content",but i want it to show the text only in one line and not 2 or more,what should i change the height to?i don't want any java code for this,my fragment is already heavy with lots of code,is there any way to do this on xml, so that it doesn't display different results for different screen size?also is there any way i can append "..." to the end of the name? like "backupRestoreConf..." or something like that?

Answers


you need to set this in xml for your textview:

 android:singleLine="true"

android:maxLines="1"

Use this in your XML


use android:maxLines="1" (or android:singleLine="true", but it was deprecated and now it is not anymore. What to think.)


Need Your Help

algorithm to match number of items value to be as close to price point(JAVA)

java algorithm np

I'm not looking for answers, as this is a internship interview question for their coding problem. Rather, i'm looking a clue to head in the right direction.

Retrieve multiple values from matlab string

arrays matlab indexing char

I currently have a large single row array of chars... I also have two arrays, the first array has all the start indexes of data I would like to retrieve from the char array, the second array has al...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.