<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="5dp" android:orientation="horizontal" > <TextView android:id="@id/swicherLabelTxt" android:text="系统公告:" android:textColor="@color/red" android:textSize="18sp" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextSwitcher android:id="@id/textSwicher" android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" android:orientation="vertical" > <include layout="@layout/common_switch"/> </LinearLayout>
部分java代码
@Override public View makeView() { MarqueeTextView tv = new MarqueeTextView(getActivity()); tv.setSingleLine(true); tv.setFocusable(true); tv.setEllipsize(TruncateAt.MARQUEE); tv.setMarqueeRepeatLimit(-1); tv.setText(resources[id]); return tv; }
所需代码放附件
相关推荐
TextView实现文字的跑马灯效果&TextSwitcher实现文字竖直飞出和飞入,使用的纯代码布局方式。
自定义垂直跑马灯LinearLayout
自定义TextSwitcher实现垂直滚动效果,文章介绍https://blog.csdn.net/qizhenyibao/article/details/80817648
TextSwitcher是系统的原生类,调用它实现文字滚动效果非常流畅。
使用TextSwitcher实现多个文字从下到上轮播出现,点击后跳转到相对应界面
TextSwitcher:仿京东、淘宝滚动小广播,实现文字轮播滚动
Android 文字跑马灯文字水平自动滚动控件及效果演示,文字左右移动特效,文字滚动速度可调、文本颜色也可以自定义,可以用手触屏来控制是否停止文字滚动,控制点击停止或者继续运行,在开始滚动前,对文字样式做以下...
主要介绍了Android TextSwitcher实现文字上下翻牌效果(铜板街),需要的朋友可以参考下
实现了公告栏 文字 3D 翻转动画效果,无限循环播放。具有向上 或者向下翻转特效。可自定义文字大小;
TextSwitcher:搜索框仿京东、淘宝滚动小广播,实现文字轮播滚动
图片轮播 文字轮播 ImageSwitcher TextSwitcher
Android TextSwitcher Demo 实例
该资源主要讲解ViewSwitcher 下的ImageSwitcher和TextSwitcher 的实现实例,希望对你有帮助,免费下载!
android官方的textswitcher demo,textview内容的切换(带动画效果)。
Android 中textSwitcher与imageSwitcher的使用
主要介绍了Android开发实现自动切换文字TextSwitcher功能,结合实例形式详细分析了Android使用TextSwitcher实现文字自动切换的原理、实现方法及相关操作注意事项,需要的朋友可以参考下
智能家居系统 文本切换TextSwitcher.doc 学习资料 复习资料 教学资源
android-TextSwitcher-master.zip对你的学习会有帮助的