适用于Android的垂直字幕 TextView

68747470733a2f2f6170692e62696e747261792e636f6d2f7061636b616765732f61796c7461692f6d6176656e2f416e64726f69642d4c69622d566572746963616c4d61727175656554657874566965772f696d616765732f646f776e6c6f61642e737667

68747470733a2f2f7472617669732d63692e6f72672f61796c7461692f416e64726f69642d4c69622d566572746963616c4d61727175656554657874566965772e7376673f6272616e63683d6d6173746572

68747470733a2f2f636972636c6563692e636f6d2f67682f61796c7461692f416e64726f69642d4c69622d566572746963616c4d61727175656554657874566965772e7376673f7374796c653d737667

68747470733a2f2f636f6465736869702e636f6d2f70726f6a656374732f34333638373861302d303731372d303133342d313339302d3261373933326633616432352f7374617475733f6272616e63683d6d6173746572

68747470733a2f2f7777772e626974726973652e696f2f6170702f653531626162386535333864643233632e7376673f746f6b656e3d4b33576a7737704a7766315f524f47454b315a2d4c77266272616e63683d6d6173746572

68747470733a2f2f64617368626f6172642e62756464796275696c642e636f6d2f6170692f737461747573496d6167653f61707049443d353734396261386637383939363730313030363262663537266272616e63683d6d6173746572266275696c643d6c6174657374

具有垂直字幕效果的自定义 TextView。

b67e2d1a174a70c0ae7221e42fb26b54.png

f850f7233be028166f0a046c71137b5c.png

ef423ae34049022136343605c7e9cdd3.png

特性当TextView添加到视图时自动启动字幕效果。

可以定制的字幕速度

易于扩展和定制

安装repositories {

jcenter()

}

dependencies {

compile 'android.lib.verticalmarqueetextview:VerticalMarqueeTextView:+'

}

下面是生成上述屏幕截图的示例布局:<?xml version="1.0" encoding="utf-8"?>

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:example="http://schemas.android.com/apk/res-auto"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical">

android:layout_width="wrap_content"

android:layout_height="0dp"

android:layout_weight="1"

android:layout_gravity="center_horizontal"

android:scaleType="centerInside"

android:src="@android:drawable/sym_def_app_icon"/>

android:layout_width="match_parent"

android:layout_height="0dp"

android:layout_weight="1"

android:layout_gravity="center_horizontal"

example:marqueeSpeed="25"

example:textSize="20dp"

example:textColor="@android:color/white"

example:textStyle="bold"

example:text="The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."/>

android:layout_width="match_parent"

android:layout_height="0dp"

android:layout_weight="1"/>

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐