How to use ScrollView in Android?

前端 未结 8 1675
抹茶落季
抹茶落季 2020-11-22 11:41

I have an XML layout file, but the text is more than fits into the screen size. What do I need to do in order to make a ScrollView?



        
8条回答
  •  被撕碎了的回忆
    2020-11-22 12:35

    To scroll data in text view you can use this to your text view. and add and for anything other layout you can just add scroll view on layout as people are saying above.

    /** android:scrollable=true at textview in xml layout.

    TextView txtScroll = (TextView) findViewById(R.id.txt1);
            txtScroll.setMovementMethod(new ScrollingMovementMethod());
    

    *//

提交回复
热议问题