We can set single line with this
TextView textView = (TextView) view.findViewById(R.id.someTextView);
textView.setSingleLine(true);
But for get status of single line event getSingleLine()
does not exit.
How can check that single line for text view is on (true) or off (false)?
My target API level is 15.
You should use
getMaxLines()
.The docs for
setSingleLine()
say that:My undesrtanding of this, is that they are juts putting a nice wrapper around
setMaxLines(1)
and some others.And under the covers, this method does indeed set the line count to 1.