AI摘要

本文介绍了在Android中为TextView添加滚动条的方法。通过在TextView外层添加一个ScrollView布局,可以实现滚动功能。具体代码示例包括ScrollView和TextView的属性设置。
本文介绍了在Android中为TextView添加滚动条的方法。通过在TextView外层添加一个ScrollView布局,可以实现滚动功能。具体代码示例包括ScrollView和TextView的属性设置。

向android TextView添加滚动条,在网上查了一下,有两种方法,直接添属性和代码的不行,只有增加布局这个经测试是OK,增另一个Scrollview就可以了。

《ScrollView

android:layout_width="fill_parent"  
android:layout_height="wrap_content" 》   
《TextView  
    android:layout_width="fill_parent"  
    android:layout_height="wrap_content"  
    android:textSize="50dp"  
    android:text="a\na\na\na\na\na\na\na\na\na\na\na\na\na\n" /》

《/ScrollView》



最后修改:2014 年 05 月 09 日
点赞的人是最酷的