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 ...
随机推荐
- LeetCode - 204. Count Primes - 埃拉托斯特尼筛法 95.12% - (C++) - Sieve of Eratosthenes
原题 原题链接 Description: Count the number of prime numbers less than a non-negative number, n. 计算小于非负数n的 ...
- maven+spring mvc初尝试
只是一个可以运行的例子,俺们来看看. 目录结构: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xml ...
- bootstrap data
bootstrap data 用法 <div data-role="page" data-last-value="43" data-hidden=&quo ...
- [小知识] 获取浏览器UA标识
这个随笔纯粹是小知识的积累,以后都会打上小知识的标签. 经常见的,下载移动app时,只有一个二维码,但扫码后,会根据手机是iphone还是android下载不同app,下面就是这个操作的代码: < ...
- [Redux] Implementing combineReducers() from Scratch
The combineReducers function we used in previous post: const todoApp = combineReducers({ todos, visi ...
- [AngularJS] Using AngularJS's ngClass
.blue{ color: blue } .bold{ font-weight: bold; } .large{ font-size: 40px; } ngClass can accept an ar ...
- [Javascript] Array methods in depth - some
some returns a boolean value after passing each item in the source array through the test function t ...
- Spring学习笔记——Spring中的BeanFactory与FactoryBean
BeanFactory BeanFactory是Spring的org.springframework.beans.factory下的一个接口,是Spring IOC所遵守的基本编程规范.他的实现类有D ...
- WSAWaitForMultipleEvents()
简述:只要指定事件对象中的一个或全部处于有信号状态,或者超时间隔到,则返回. #include <winsock2.h> DWORD WSAAPI WSAWaitForMultipleEv ...
- 重学《C#高级编程》(继承)
前两天重新看了<C#高级编程>里的第四章:继承与第六章:数组.OOP三大特性:封装,继承,多态,个人感觉继承是实现多态的基础,包括以后接触的设计模式,都是继承特性的衍生. 继承特性有两种, ...