方法一:

TextView文字过多,显示不全,怎么办?我们可以为Textview添加滚动条。

<TextView
android:id="@+id/bus_detail_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#000000"
android:scrollbars="vertical"
android:singleLine="false"
/>

Activity添加的代码为

busDetailContent=(TextView)findViewById(R.id.bus_detail_content);

busDetailContent.setMovementMethod(ScrollingMovementMethod.getInstance());

方法二:

纯XML

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:scrollbars="vertical" android:fadingEdge="vertical">
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content"
android:id="@+id/text_view" android:textColor="#071907" android:paddingTop="5dip" />
</ScrollView>

Android TextView文字过多时通过滚动条显示多余内容的更多相关文章

  1. Android TextView文字超出一屏不能显示其它的文字 解决方案

    在android上面让TextView 过多的文字实现有滚动条,之前想简单了以为设置TextView的属性就可以实现,结果还是需要ScrollView配合使用,才能达到滚动条的效果有两种方式实现, 一 ...

  2. Android:TextView文字跑马灯的效果实现

    解决TextView文字显示不全的问题. 简单设置跑马灯的效果: <TextView android:id="@+id/textView" android:layout_wi ...

  3. Android TextView 文字居中

    有2种方法可以设置TextView文字居中: 一:在xml文件设置:android:gravity="center" 二:在程序中设置:m_TxtTitle.setGravity( ...

  4. Android TextView文字描边的实现!!

    Android开发:文字描边 转自:http://www.oschina.net/code/snippet_586849_37287 1. [代码][Java]代码 1 2 3 4 5 6 7 8 9 ...

  5. Android TextView文字横向自动滚动(跑马灯)

    TextView实现文字滚动需要以下几个要点:   1.文字长度长于可显示范围:android:singleLine="true"   2.设置可滚到,或显示样式:android: ...

  6. Android—— TextView文字链接4中方法

    转自:http://ghostfromheaven.iteye.com/blog/752181 Android 的实现TextView中文字链接的方式有很多种. 总结起来大概有4种: 1.当文字中出现 ...

  7. Android TextView文字透明度和背景透明度设置

    textview1.setTextColor(Color.argb(255, 0, 255, 0)); //文字透明度 控件设为半透明: 控件名.getBackground().setAlpha(in ...

  8. android TextView 文字垂直的设置

    <TextView android:id="@+id/tv_status" android:layout_width="wrap_content" and ...

  9. Android TextView文字空格

     表示全角空格, <string name="aaa">你好      啊</string> http://stackoverflow.com/questi ...

随机推荐

  1. 排查 “Detected Tx Unit Hang”问题

    实现功能: 使用自己已经分配的内存让skb->data指向,而不是使用alloc_malloc(). 部分代码如下: /* * build a new sk_buff */ //struct s ...

  2. How to use Variables in different component

    1. In Script Task component Set Value: Dts.Variables["ErrorMsg"].Value = string.Format(&qu ...

  3. Odoo many2many command

    CREATE = lambda values: (0, False, values) // (0,False, Values) //创建 UPDATE = lambda id, values: (1, ...

  4. Java学习从入门到精通(1) [转载]

    Java Learning Path (一).工具篇 一. JDK (Java Development Kit) JDK是整个Java的核心,包括了Java运行环境(Java Runtime Envi ...

  5. css进阶读书笔记

    说明:努力在十一左右,最迟双11之前掌握所有css知识要点 一.摘自<写给大家看的CSS书(第2版)>(虽然书比较旧,09年版的,但对于我这种刚入门的小菜鸟 来说,能学到的还是挺多的) 1 ...

  6. VB中的排序问题 15个

    首次接触VB,以下就先进行VB中的排序问题                   Dim a As Integer Dim b As Integer Dim c As Integer Dim d As ...

  7. 编程算法 - 求1+2+...+n(构造函数) 代码(C++)

    求1+2+...+n(构造函数) 代码(C++) 本文地址: http://blog.csdn.net/caroline_wendy 题目: 求1+2+...+n, 要求不能使用乘除法\for\whi ...

  8. redhat 网络配置

    1. 查看网络 ifconfig 网卡名字(eth0.wlan0) ifconfig -a //查看所有网卡配置 2. 网卡打开\关闭 ifconfig eth0 down ifconfig eth0 ...

  9. SpringBoot Idea 启动报错 Process finished with exit code 1

    问题描述:没有其他任何错误日志,只有Process finished with exit code 1 问题原因:Maven POM.xml问题造成 由于是properties是我直接从其他项目中拷贝 ...

  10. Socket编程之Tomcat模拟_采坑汇总

    用java.net.Socket来模拟实现Tomcat,碰到了一些坑,大部分是没有想到的,记录下来自查. 直接上代码, public class TomcatDemo { private static ...