Android:TextView跑马灯-详解
Android:TextView跑马灯_详解
引言:
TextView之所以需要跑马灯,是由于文字太长,或者是吸引眼球。
关键代码如下:
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
属性详解:



还有两个函数由于在Android开发手册中没有找到,但是从字面上可以看出
android:focusable="true"
是指出在得到焦点后触发事件。
android:focusableInTouchMode="true"
是指不用捞取焦点,就触发事件。也就是説一运行,就触点该事件。
android:singleLine="true"
是设置TextView只显示一行
实例
<TextView
android:id="@+id/horseRace Lamp"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:marqueeRepeatLimit="marquee_forever"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
android:text="Welcom to FDA-orangebook's blogs"
/>
Android:TextView跑马灯-详解的更多相关文章
- Android——TextView属性XML详解
Android_TextView属性XML详解 博客分类: android 属性名称 描述 android:autoLink 设置是否当文本为URL链接/email/电话号码/map时 ...
- android textview 跑马灯
<TextView android:layout_width="match_parent" android:layout_height="48dp" an ...
- Android TextView 跑马灯效果 - 2018年6月19日
第一步在布局中添加加粗部分代码: <TextView android:id="@+id/tv_company" android:layout_width="0dp& ...
- Android TextView跑马灯
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content&q ...
- 在android中用跑马灯的效果显示textview
大家好,在我们通常的android project中,通常需要用到textview这一个布局文件,并且对于这一个显示布局所需要的文本文字内容. 下面我们就来介绍一种方法来实现在android中用跑马灯 ...
- 【Android】不依赖焦点和选中的TextView跑马灯
前言 继承TextView,并仿照源码修改而来,主要是取消了焦点和选中了判断,也不依赖文本的宽度. 声明 欢迎转载,但请保留文章原始出处:) 博客园:http://www.cnblogs.com 农民 ...
- 【Android】TextView跑马灯效果
老规矩,先上图看效果. 说明 TextView的跑马灯效果也就是指当你只想让TextView单行显示,可是文本内容却又超过一行时,自动从左往右慢慢滑动显示的效果就叫跑马灯效果. 其实,TextView ...
- 【Android】不依赖焦点和选中的TextView跑马灯【2】
前言 之前有写一篇TextView跑马灯的效果,后来实际项目中有发现新的问题,比如还是无法自动跑,文本超过了显示区域就截取的问题,今天换了一种思路来实现,更简单更好用. 声明 欢迎转载,但请保留文章原 ...
- Third Day:正式编程第三天,学习实践内容TextView跑马灯、AutoCompleteTextView、multiAutoCompleteTextView以及ToggleButton、checkedBox、RadioButton等相关实践
2.针对Focused的TextView跑马灯(文字较多一行无法显示)效果 针对单个TextView的跑马灯效果,可直接在TextView控件参数中添加三个属性: android:singleLine ...
随机推荐
- 关于使用axis调用webservice接口方法
1.概述: 我们有时候会调用webserviec接口,我们向接口发送请求参数,从接口接收返回值. 2.形式: package client; import org.apache.axis.client ...
- 一步一步教你做ios推送
最近在研究ios的推送问题,遇到了一些问题,最终整理了一下.放在这里和大家分享 APNS的推送机制 首先我们看一下苹果官方给出的对ios推送机制的解释.如下图 Provider就是我们自己程序的后台服 ...
- Web服务的体系架构
Web简介: Web是WWW(World Wide Web)的简称,又称为万维网,是建立在客户机/服务器上的,以HTML语言和HTML协议为基础,提供面向Internet服务的,有一致用户界面的一种信 ...
- X Shell 4配色方案[Solarized Dark]
X Shell 4是个很好的Windows下登录Linux服务器的终端,比Putty好用 X Shell 4的下面这种方案,我个人很喜欢 用vim写shell脚本的效果: 按如下步骤配置: 1)把下面 ...
- FeatureClass的"import"(转换)功能
/// <summary> /// FeatureClass的"import"功能. /// </summary> /// <param name=& ...
- Sql时间函数
一.sql server日期时间函数 Sql Server中的日期与时间函数 1. 当前系统日期.时间 select getdate() 2. dateadd 在向指定日期加上一段时间 ...
- java下udp的DatagramSocket 发送与接收
发送 package cn.stat.p4.ipdemo; import java.io.BufferedReader; import java.io.IOException; import java ...
- c++ 链表删除重复的数据
//List.h #include <iostream> typedef int dataType; struct Node{ Node():data(),pNextNode(NULL){ ...
- ubuntu下的c/c++环境搭建
原文地址:http://www.cnblogs.com/hitwtx/archive/2011/12/03/2274556.html ubuntu下的c/c++环境搭建是比较简单,因为有apt和新立得 ...
- web移动开发的小细节(持续添加)
1.触屏设备上如何去掉数字转化为拨号链接的方法 <meta name=”format-detection” content=”telephone=no” /> telephone=no就禁 ...