实现TextView滚动
来源:互联网 发布:数据分析入门 python 编辑:程序博客网 时间:2024/06/05 00:27
实现TextView滚动功能。
自定义TextView.
/* * Copyright (C) 2013 Capital Alliance Software LTD (Pekall) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package com.pekall.fmradio;import android.content.Context;import android.util.AttributeSet;import android.widget.TextView;/** * Marquee Text to make it scrolling even without real focus */public class MarqueeText extends TextView { public MarqueeText(Context arg0, AttributeSet arg1, int arg2) { super(arg0, arg1, arg2); } public MarqueeText(Context context, AttributeSet attrs) { super(context, attrs); } public MarqueeText(Context context) { super(context); } @Override public boolean isFocused() { return true;//自定义的目的这里是关键 }}
<com.pekall.fmradio.MarqueeText android:id="@+id/info_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="20dip" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:gravity="center" android:marqueeRepeatLimit="marquee_forever" android:paddingLeft="10dip" android:paddingRight="10dip" android:paddingTop="2dip" android:singleLine="true" android:textColor="#FF92c2f3" android:textSize="20sp" android:textStyle="bold" />
marqueeRepeatLimit
singleLine
focusable
ellipsize
focusableInTouchMode
0 0
- TextView 滚动如何实现
- TextView实现滚动效果
- TextView实现字体滚动
- TextView 实现 滚动条
- 实现TextView滚动
- TextView实现滚动播放
- Android TextView实现滚动效果
- TextView滚动功能的实现
- 实现上下滚动的TextView
- 实现上下滚动的TextView
- 实现上下滚动的TextView
- Android TextView实现滚动条
- TextView,Button实现滚动字幕
- 垂直滚动textview自定义实现
- TextView实现自动滚动显示
- TextView各种滚动动画实现
- android----TextView如何实现无限滚动显示
- android TextView 如何实现消息滚动
- struts2使用可生成交互的两个列表框的optiontransferselect标签
- C++11 bind函数实现原理图
- [LeetCode] Course Schedule II
- 两栈共享空间
- linux vi使用
- 实现TextView滚动
- web.xml 中的listener、 filter、servlet 加载顺序及其详解
- POJ 3278 Catch That Cow【C语言版】
- Solution to CLRS Chapter 2
- 欢迎使用CSDN-markdown编辑器
- 文件的上传与下载
- 下辈子,都不会再见了
- JNI/NDK开发指南(十一)——JNI异常处理
- windows系统实现mysql数据库数据库主从复制