https://www.viralandroid.com/2015/10/how-to-make-scrollable-textview-in-android.html
Android TextView allows user to display text in android application. In this tips, I will show how to make scrollable TextView in android. To make TextView scrollable, you don’t need to use ScrollView, just addandroid:scrollbars=”vertical” attribute in TextView and then add two line of code in your java activity file.
Related:
How to Align Android TextView in the Center of the Screen
How to Set Android Button and TextView Border Color
Android Material Design with Design Support Library
XML Layout File
Following is the xml layout file which contain a LinearLayout and a TextView.
res/layout/scrollable_textview.xml
Java Activity File
Following is the final code of MainActivity.java file.
src/MainActivity.java
Now, run your application and see texts are scrolling.
Output:
Android TextView allows user to display text in android application. In this tips, I will show how to make scrollable TextView in android. To make TextView scrollable, you don’t need to use ScrollView, just addandroid:scrollbars=”vertical” attribute in TextView and then add two line of code in your java activity file.
Related:
How to Set Android Button and TextView Border Color
Android Material Design with Design Support Library
XML Layout File
Following is the xml layout file which contain a LinearLayout and a TextView.
res/layout/scrollable_textview.xml
Java Activity File
Following is the final code of MainActivity.java file.
src/MainActivity.java
Now, run your application and see texts are scrolling.
Output:
Scrollable TextView |
Comments
Post a Comment