Giter VIP home page Giter VIP logo

lkayoutubelikeloadingindicatorview's Introduction

LKAYoutubeLikeLoadingIndicatorView License MIT

Loading Indicator Inspired by YouTube App 模仿实现 YouTube iOS 端 APP 的加载内容指示器

动画效果

Screenshot

安装

复制 LKAYoutubeLikeLoadingIndicatorView.h / LKAYoutubeLikeLoadingIndicatorView.m 到你的工程 导入头文件

#import "LKAYoutubeLikeLoadingIndicatorView.h"

如何使用 LKAYoutubeLikeLoadingIndicatorView

手动创建与添加 LKAYoutubeLikeLoadingIndicatorView 类或者通过 Storyboard 设置 UIView 的 custom class 为 LKAYoutubeLikeLoadingIndicatorView

设置指示器的 Line Width, 默认值为 5

self.loadingIndicatorView.lineWidth = 10;

设置指示器的变化颜色数组,当数组只含有一个 UIColor 时,指示器颜色不变,默认是一个包括四种颜色的数组,颜色取值来自 YouTube App.

self.loadingIndicatorView.spinnerColors = @[
                            [UIColor colorWithRed:0.26 green:0.52 blue:0.96 alpha:1.00],
                            [UIColor colorWithRed:0.85 green:0.23 blue:0.17 alpha:1.00],
                            [UIColor colorWithRed:0.96 green:0.71 blue:0.00 alpha:1.00],
                            [UIColor colorWithRed:0.07 green:0.62 blue:0.35 alpha:1.00]
                       ];

设置指示器停止动画时,是否隐藏自身.类似与UIKit中的 UIActivityIndicatorViewhidesWhenStopped属性,默认为 NO,即暂停动画后不隐藏指示器.

self.loadingIndicatorView.hidesWhenStopped = YES;

使用 startAnimating 方法开启恢复 Loading 动画.

[self.loadingIndicatorView startAnimating];

调用 stopAnimating 方法关闭 Loading 动画.

[self.loadingIndicatorView stopAnimating];

Credits

Inspired by YouTube.

License

MIT license.

lkayoutubelikeloadingindicatorview's People

Contributors

lukapool avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rain1996

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.