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:

    Enter image details here < P> Medium text:

    Enter image details here

    Internal scrolling:

    image here Enter details

    Spaces:

     Enter image details here

    Excessive length:

     Enter image description here

    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

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -