您的位置:首页 > 移动开发 > Android开发

android 用textview实现文字滚动效果

2012-06-19 10:25 302 查看
如果不设置文字字体的颜色,而是使用系统默认的白色字体,滚动时屏幕会变暗,解决办法设置字体的颜色就可以了。

XML内textview代码:

<TextView 
         android:id="@+id/textview1"
         android:layout_width="fill_parent" 
         android:layout_height="wrap_content"
         android:scrollbars="vertical"
         android:textColor="#FFFFFF"
         android:focusable = "true"
         />
J***A代码里加上监听器:

tv = (TextView) findViewById(R.id.textview1);	
tv.setMovementMethod(ScrollingMovementMethod.getInstance());
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: