On Android above let TextView too much text implementation has scroll bar, before want to simply think that set textview properties can be implemented, the result or need to use ScrollView, in order to achieve the effect of the scroll bar two ways to achieve,
One is the layout of code-written Java:
01.relativelayout.layoutparams param = new Relativelayout.layoutparams (80,80); 02.//initialization of the scrollbar control 03.ScrollView ScrollView =new ScrollView (this); 04.scrollview.setscrollcontainer (true); 05.scrollview.setfocusable (true); 06.//initialization of text control 07.TextView TextView = new TextView (this); 08.textview.sethorizontallyscrolling (true); 09.textview.settext ("hahaha, \ n hahaha"); 11.scrollview.addview (textView); 12.main_view.addview (ScrollView, param);
The other is implemented with Layout.xml:
01.<ScrollViewandroid:layout_width.= "Fill_parent"android:layout_height.= "Fill_parent"Android:scrollbars.= "vertical"Android:fadingedge.= "vertical">06.07. <TextViewAndroid:id.= "@+id/textview"android:layout_width.= "Wrap_content"Ten. Android:layout_height= "Wrap_content"Android:text.= "Demo"android:textsize.= "15SP"/>.</ScrollView>
Android TextView text Beyond one screen cannot display other text solutions