主要用的是android自带的TextSwitcher,很好用,结合着动画效果。
首先是布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:background="#aaafff"
android:gravity="center"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="40dp">
<ImageView
android:src="@mipmap/home_sign"
android:id="@+id/imag"
android:layout_width="40dp"
android:layout_height="40dp" />
<TextSwitcher
android:layout_marg