How to disable the TextView maxLines programmatically?

Viewed 27054

I'm having a hard time reseting the maxLines attribute of a TextView programmatically.

Just tried setting to 0 and it doesn't work. -1 crashes the application. I could use a simpler workaround and set the maxLines to 5000 but I don't want to do that.

Any ideas how to do that?

UPDATED

Well, I've found one problem.. I've set the Ellipsize as well... I'm just going to use the following workaround:

TextView questionDetail = (TextView) mQuestionDetailHeader.findViewById(R.id.desc);

questionDetail.setText(mCurrentQuestion.getQuestion());
questionDetail.setMaxLines(Integer.MAX_VALUE); //As in the android sourcecode
questionDetail.setEllipsize(null);
4 Answers
Related