Android跑马灯的实现
这篇文章主要是讲解在Android中跑马灯的做法,以及介绍Textview的一些属性。
(1)了解textview的一些属性
这里我们通过代码来了解textview的一些属性,重点内容另外展示。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="20dp" <!--设置布局里面控件距离顶部的距离-->
android:paddingLeft="20dp">
<TextView
android:id="@+id/text1"
android:layout_width="200dp"
android:layout_height="20dp"
android:ellipsize="marquee"
android:text="五大才子队必或国奖"
android:onClick="anniu"<!--可以设置点击事件,在对应的Ativity里面写名为anniu的方法。设置自己想要的一些触发事件->
android:textColor="#09F709"
><