首页 > 其他 > 详细

shimmer使用方法(文本闪烁)

时间:2017-03-22 15:13:34      阅读:476      评论:0      收藏:0      [点我收藏+]

1.github下载  https://github.com/facebook/shimmer-android

2.copy ShimmerFrameLayout.java 连同包名到java目录

3.copy attrs.xml 到 values 目录

4.

<com.facebook.shimmer.ShimmerFrameLayout
        android:id="@+id/shimmer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Hello World!Hello World!Hello World!Hello World!Hello World!" />
</com.facebook.shimmer.ShimmerFrameLayout>

5.

ShimmerFrameLayout shimmar = (ShimmerFrameLayout) findViewById(R.id.shimmer);
shimmar.startShimmerAnimation();

注:各种style

        mShimmerViewContainer.setDuration(5000);
        mShimmerViewContainer.setRepeatMode(ObjectAnimator.REVERSE);

        mShimmerViewContainer.setBaseAlpha(0.1f);
        mShimmerViewContainer.setDropoff(0.1f);
        mShimmerViewContainer.setTilt(0);

        mShimmerViewContainer.setAngle(ShimmerFrameLayout.MaskAngle.CW_90);

        mShimmerViewContainer.setBaseAlpha(0);
        mShimmerViewContainer.setDuration(2000);
        mShimmerViewContainer.setDropoff(0.1f);
        mShimmerViewContainer.setIntensity(0.35f);
        mShimmerViewContainer.setMaskShape(ShimmerFrameLayout.MaskShape.RADIAL);

 

 

 

  

shimmer使用方法(文本闪烁)

原文:http://www.cnblogs.com/linson0116/p/6599954.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!