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
- Swift跑馬燈效果Swift
- HTMl 中marquee標籤實現無縫滾動跑馬燈效果HTML
- TextView跑馬燈效果與addStatesFromChildren屬性關係TextView
- 影片直播原始碼,Android TextView設定跑馬燈效果原始碼AndroidTextView
- zeptojs-跑馬燈效果JS
- 一個有上下滾動效果的TextViewTextView
- 公告欄跑馬燈效果程式碼
- Android開發之TextView文字水平滾動效果實現AndroidTextView
- 前端實現文字滾動效果前端
- 文字垂直迴圈滾動效果
- androidTextView實現簡單的跑馬燈效果AndroidTextView
- Android 設定TextView滑動滾動條和滑動效果AndroidTextView
- 微信小程式如何開發跑馬燈效果?微信小程式
- Flutter實現Android跑馬燈及滾動廣告FlutterAndroid
- 用程式碼簡單的實現跑馬燈效果
- VUE-文字跑馬燈Vue
- 微信小程式之文字向上滾動效果微信小程式
- jquery 感應滑鼠移動的文字3d滾動效果jQuery3D
- 隱藏滾動條保留滾動效果
- 實現隨著滾動條滾動,導航會自動切換的效果
- 滑鼠雙擊頁面實現自動滾動效果
- TextView走馬燈TextView
- 跑馬燈帶你深入淺出TextView的原始碼世界TextView原始碼
- Vue實現跑馬燈效果以及封裝為元件釋出Vue封裝元件
- CSS 數學函式與容器查詢實現不定寬文字溢位跑馬燈效果CSS函式
- 拖動滾動條實現內容自動載入效果
- 按鈕滾動條效果
- 結合 CSS3 transition transform 實現簡單的跑馬燈效果CSSS3ORM
- 【Android】不依賴焦點和選中的TextView跑馬燈AndroidTextView
- JS圖片自動或者手動滾動效果(支援left或者up)JS
- 超出文字顯示省略號,hover效果:文字滾動顯示==》求解
- 前端實現文字跑馬燈的三種方式前端
- android 讓 TextView 自帶滾動條AndroidTextView
- 直播軟體搭建,Android實現文字滾動播放效果Android
- js、jQuery實現文字上下無縫輪播、滾動效果JSjQuery
- 【譯】定製Flutter滾動效果Flutter
- CSS完成視差滾動效果CSS