java - How to implement a multi line TextView with max height and internal scroll -
I want to limit the amount of space a textView can take to the screen with the following rules:
- If the text is small (say 140 letters or 2 lines), then take as much space as you need it.
- If the text is long, paragraphs,
To illustrate some of the screenshots for valid and invalid results, go to:
Short text:
< P> Medium text:
Internal scrolling:
Spaces:
Excessive length:
Try this way. Android: layout_height = "wrap_content" android: maxLines = "5" Android: scrollbar = "vertical" Android:
Android: Text = "Lorem Ipsum bus printing And the dummy lesson of the typesetting industry is Lorem Ipsum has been the industry and standard standard dummy text ever since the 1500s. "Android: textColor =" # 232e3b "Android: Typeface =" sans "/>
In Java
descTxtView = (TextView) findViewById (R.id.descTxtView); DescTxtView.setMovementMethod (new scrollingwall moderation);
Comments
Post a Comment