---
title: "Android 跑马灯效果"
author: "LoveZhou"
date: "2011-02-15T11:20:31Z"
tags: ["Android", "XML"]
categories: ["移动开发"]
slug: "android"
draft: false
lastmod: "2011-02-15T11:21:02Z"
id: 906563
url: "https://lovezhou.iteye.com/blog/906563"
---

Android 跑马灯效果是通过TextView来实现的，前提是TextView显示的内容必须比TextView控件分配的宽度宽，并且保证TextView里面的内容是单行显示，然后通过TextView的 ellipsize="marquee" 来设置跑马灯效果 效果图： \[img]http://dl.iteye.com/upload/attachment/416419/9441cd4d-0044-3e88-9cc6-cf2854e01f7c.png\[/img] 代码： \[code="java"] \[/code]