---
title: "跑马灯效果"
author: "wangxinasy"
date: "2010-10-20T22:17:18Z"
tags: []
categories: ["移动开发"]
slug: "untitled"
draft: false
lastmod: "2010-10-20T22:17:18Z"
id: 789971
url: "https://wangxinasy.iteye.com/blog/789971"
---

一、效果图
　　　　 
　　二、实现代码：
    <TextView android:layout_width="100px"
        android:layout_height="wrap_content"
        android:textColor="@android:color/white" 
        android:ellipsize="marquee" 
        android:focusable="true" 
        android:marqueeRepeatLimit="marquee_forever" 
        android:focusableInTouchMode="true" 
        android:scrollHorizontally="true"
        android:text="这才是真正的文字跑马灯效果"
        >
    </TextView>
　　　　代码说明:
　　　　　　a).　　经测试与转载文章区别主要在于这里有设置android:focusableInTouchMode
　　　　　　b).　　测试环境为Android1.5、模拟器。