android 让TextView自带滚动条
2016-02-27 09:39
597 查看
android 让 TextView 自带滚动条
一、Xml代码<TextView
android:id="@+id/textview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="false"
android:maxLines="5"
android:scrollbars="vertical"
/>
二、还需要在代码中设置 TextView 相应的方法
TextView textView = (TextView)findViewById(R.id.text_view);
textView.setMovementMethod(ScrollingMovementMethod.getInstance());
好了,大功告成。
相关文章推荐
- Android本地数据安全尝试(中)——Conceal
- 浅谈Android App开发中Fragment的创建与生命周期
- android开发 不注意的异常
- Android如何查看应用签名信息
- Android.mk的一些FAQ
- 应用开机启动及相关文档翻译
- Android不规则瀑布流照片墙的实现+LruCache算法
- 个人进阶之路——自定义控件(5)
- android 8种对话框(Dialog)使用方法汇总
- Android Resources$NotFoundException异常
- android第一个项目-计算你的生存日子之年龄计算器
- [Android]开源中国源码分析之二---DrawerLayout
- Android的Activity跳转和传值
- android加载大量图片内存溢出的三种解决办法
- Android Fragment
- Android--Dialog对话框
- 【学习笔记】day1_快速入门 03_Android体系结构
- Android 第一天重置版的一些技巧
- android ant打包参考
- Android development Notes-3(Activity, Intents, and Tasks, Service, Content provider)