Giter Club home page Giter Club logo

androidmarqueeview's Introduction

AndroidMarqueeVie 跑马灯

1、可以自定义字体颜色,字体大小。

2、可以设置是否重复滚动。

3、可以设置滚动方向。

4、可以设置滚动速度。

5、可以设置滚动的位置。

6、可以停止和开始滚动。

#效果图

设置1:设置不可重复滚动,滚动完毕不在滚动(方向向左)

     <com.dalong.marqueeview.MarqueeView
            android:id="@+id/mMarqueeView"
            app:textcolor="@color/colorAccent" //滚动字体的颜色
            app:textSize="16sp" //滚动字体的大小
            app:startPoint="end"//滚动起点
            app:isRepeat="false"//是否重复滚动
            app:direction="left"//滚动方向
            app:speed="50"//滚动速度
            android:layout_width="match_parent"
            android:layout_height="50dp" />

image

设置2:设置不可重复滚动,滚动完毕不在滚动 (方向向右)

     <com.dalong.marqueeview.MarqueeView
            android:id="@+id/mMarqueeView"
            app:textcolor="@color/colorAccent" //滚动字体的颜色
            app:textSize="16sp" //滚动字体的大小
            app:startPoint="end"//滚动起点
            app:isRepeat="false"//是否重复滚动
            app:direction="right"//滚动方向
            app:speed="50"//滚动速度
            app:marqueebackground="@color/colorPrimaryDark"//滚动背景颜色
            android:layout_width="match_parent"
            android:layout_height="50dp" />

image

设置3:设置可重复滚动,滚动完毕再次滚动 (方向向左)

     <com.dalong.marqueeview.MarqueeView
            android:id="@+id/mMarqueeView"
            app:textcolor="@color/colorAccent" //滚动字体的颜色
            app:textSize="16sp" //滚动字体的大小
            app:startPoint="end"//滚动起点
            app:isRepeat="true"//是否重复滚动
            app:direction="left"//滚动方向
            app:speed="50"//滚动速度
            app:marqueebackground="@color/colorPrimaryDark"//滚动背景颜色
            android:layout_width="match_parent"
            android:layout_height="50dp" />

image

设置4:设置可重复滚动,滚动完毕再次滚动 (方向向右)

     <com.dalong.marqueeview.MarqueeView
            android:id="@+id/mMarqueeView"
            app:textcolor="@color/colorAccent" //滚动字体的颜色
            app:textSize="16sp" //滚动字体的大小
            app:startPoint="end"//滚动起点
            app:isRepeat="true"//是否重复滚动
            app:direction="right"//滚动方向
            app:speed="50"//滚动速度
            app:marqueebackground="@color/colorPrimaryDark"//滚动背景颜色
            android:layout_width="match_parent"
            android:layout_height="50dp" />

image

设置5:设置速度

     <com.dalong.marqueeview.MarqueeView
            android:id="@+id/mMarqueeView"
            app:textcolor="@color/colorAccent" //滚动字体的颜色
            app:textSize="16sp" //滚动字体的大小
            app:startPoint="end"//滚动起点
            app:isRepeat="true"//是否重复滚动
            app:direction="right"//滚动方向
            app:speed="20"//滚动速度
            app:marqueebackground="@color/colorPrimaryDark"//滚动背景颜色
            android:layout_width="match_parent"
            android:layout_height="50dp" />

image

如何使用

dependencies {
    compile 'com.dalong:marqueeview:1.0.1'
}

androidmarqueeview's People

Contributors

yixiaolunhui avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.