Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

MarqueeView

> 编程语言
Open source

自定义跑马灯MarqueeView,用TextView 出现了各种坑啊 , 尤其是在页面中同时存在EditText 的时候,简单的用法,完善的功能,希望您能喜欢!

357 stars0 likes0 views
WebsiteGitHub

About

自定义跑马灯MarqueeView,用TextView 出现了各种坑啊 , 尤其是在页面中同时存在EditText 的时候,简单的用法,完善的功能,希望您能喜欢!

MarqueeView

自定义跑马灯MarqueeView,用TextView 出现了各种坑啊 , 尤其是在页面中同时存在EditText 的时候,简单的用法,完善的功能,希望您能喜欢!

 效果图  :

gif录制出来有点怪,可以安装看看实际效果

HowTo Use?/如何使用?-

1: Download

直接把MarqueeView这个类放到项目里面

OR

1.先在 build.gradle(Project:XXXX) 的 repositories 添加:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

2.然后在 build.gradle(Module:app) 的 dependencies 添加:

dependencies {
        

	 compile 'com.github.385841539:MarqueeView:1.0.0'
  
}

2:布局文件

3:自定义属性(均设有默认值,可不使用):

属性 参数类型 说明
marqueeview_repet_type enum 循环模式
marqueeview_text_distance integer 每个item之间的距离
marqueeview_text_startlocationdistance float 开始的起始位置 按距离控件左边的百分比 0~1之间
marqueeview_text_speed float 播放速度 也就是文字滚动速度
marqueeview_text_color color reference
marqueeview_text_size float 文字大小
marqueeview_isclickalbe_stop boolean 是否点击暂停
marqueeview_is_resetLocation boolean 重新改变内容的时候 , 是否初始化 位置,默认为true,改变

4:添加 滚动文本:

mV3.setContent(content3);

5:java动态 设置属性值:

                mV3.setTextDistance(50);//设置间距
                mV3.setTextSpeed(5);//设置速度   
                mV3.setTextColor(R.color.colorAccent);//设置颜色
                mV3.setTextSize(17);//设置文字大小
                mV3.stopRoll();//停止滚动
                mV3.continueRoll();//继续滚动
 
           
 

Tips:

原理很简单,献丑了,方便大家调用,为了节省大家时间。 具体实现思路,可以查阅CSDN博客

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言