TextView跑馬燈效果,也就是,自動滾動文字的效果。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView android:id="@+id/tv"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true" //這句不能少
android:marqueeRepeatLimit="marquee_forever"
android:textColor="#FFFFFF"
android:text="longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView android:id="@+id/tv"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true" //這句不能少
android:marqueeRepeatLimit="marquee_forever"
android:textColor="#FFFFFF"
android:text="longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong"
/>
</LinearLayout>
直接複製進佈局檔案就OK了。
相關文章
- JavaFx 實現水平滾動文字(跑馬燈效果)Java
- 影片直播原始碼,Android TextView設定跑馬燈效果原始碼AndroidTextView
- HTMl 中marquee標籤實現無縫滾動跑馬燈效果HTML
- Swift跑馬燈效果Swift
- 一個有上下滾動效果的TextViewTextView
- Android 設定TextView滑動滾動條和滑動效果AndroidTextView
- 前端實現文字滾動效果前端
- androidTextView實現簡單的跑馬燈效果AndroidTextView
- Flutter實現Android跑馬燈及滾動廣告FlutterAndroid
- 微信小程式之文字向上滾動效果微信小程式
- 微信小程式如何開發跑馬燈效果?微信小程式
- 隱藏滾動條保留滾動效果
- VUE-文字跑馬燈Vue
- 直播軟體搭建,Android實現文字滾動播放效果Android
- 超出文字顯示省略號,hover效果:文字滾動顯示==》求解
- 跑馬燈帶你深入淺出TextView的原始碼世界TextView原始碼
- CSS 數學函式與容器查詢實現不定寬文字溢位跑馬燈效果CSS函式
- js、jQuery實現文字上下無縫輪播、滾動效果JSjQuery
- TextView走馬燈TextView
- Vue實現跑馬燈效果以及封裝為元件釋出Vue封裝元件
- 【譯】定製Flutter滾動效果Flutter
- CSS完成視差滾動效果CSS
- CSS水平無縫滾動效果CSS
- 教你如何實現 Android TextView 文字輪播效果AndroidTextView
- jQuery滑動方式上下左右滾動效果jQuery
- vue 數字滾動遞增效果Vue
- jQuery圖片無縫滾動效果jQuery
- 什麼是視差滾動?如何實現視差滾動的效果?
- 線上直播原始碼,JS動態效果之,側邊欄滾動固定效果原始碼JS
- 前端實現文字跑馬燈的三種方式前端
- css-虛線邊框滾動效果CSS
- 巢狀滾動效果實現討論巢狀
- 美化滾動條效果程式碼例項
- CSS3滾動條效果程式碼CSSS3
- 直播原始碼網站,實現文字自動翻轉效果原始碼網站
- OverScroll彈性滾動和慣性滾動效果的實現原理——CoordinatorLayout+Behavior
- vue2+swiper 縱向弧形滾動效果Vue
- 使用純 CSS 實現滾動陰影效果CSS
- flutter跑馬燈Flutter