In my app, I need text in myTextView to display single line without the three dots at the end. I need to show a little differently formatted text when it's too long, so something like setting maxHeight won't help since it just crops it.
My approach was to check how many lines the TextView has, and make the text in shorter if it has more than 1. This is exactly the approach I want, but since the View has to be drawn first to check LineCount, two-line layout flashes briefly before cutting the text to one-line:
myTextView.Post(() =>
{
if (myTextView.LineCount > 1)
{
// make text shorter here to fit 1 line
}
});
So my question is, is there any way to check how many lines the View will have before it is displayed to the user? I could force it based on character count in a string, but that seems wrong.