How Can I Force My Checkbox's Text To Not Wrap?
Solution 1:
CheckBox inherits from CompoundButton, which inherits from Button, which inherits from TextView. So, it has all the properties, methods and attributes of these ancestors... Reference: http://developer.android.com/reference/android/widget/CheckBox.html
In particular, you are interested to the TextView properties, methods and attributes: Reference: http://developer.android.com/reference/android/widget/TextView.html
In particular, you're interested in the android:lines
attribute, and set it to 1.
This tells your CheckBox to be exactly 1 line tall.
You might also want to set the android:ellipsize
attribute to some value (i.e.: 3 = end).
This tells your CheckBox to add three dots (ellipsis) to the end, start, center, ... of the truncated text.
[EDIT]
Being a decentant of TextView, it can use setSingleLine
- Thanks to @CrandellWS for the comment.
Post a Comment for "How Can I Force My Checkbox's Text To Not Wrap?"