Coder Social home page Coder Social logo

mahong125 / tableview_display_animation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kingofwolves/tableview_display_animation

0.0 2.0 0.0 6.21 MB

cell展示动画的封装,使用方便,只要一行代码即可,源码也非常简单,有兴趣的同学可以在源码中进行拓展

Objective-C 100.00%

tableview_display_animation's Introduction

最近在网上看到好多同学都在求列表的展示动画,所以我对这些较常用的动画做了一个封装,方便大家的使用。

Demo样式如下( gif图有些卡顿,但是Demo是流畅的,大家可以下载后运行一下):

cell_display_animation.gif

这里我对UITableViewCell进行了一个扩展,使用的时候只要导入"UITableViewCell+leoAdd.h" 文件即可,使用方法如下:

// tableView 的协议方法,在这个方法中调用即可
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
    // animationStyle: 动画类型
    [cell tableView:tableView forRowAtIndexPath:indexPath animationStyle:animationStyle];
}

动画类型目前有以下几种,Demo中都有展示:

typedef NS_ENUM(NSInteger, UITableViewCellDisplayAnimationStyle) {
    UITableViewCellDisplayAnimationTop = 0, // line by line
    UITableViewCellDisplayAnimationLeft = 1,
    UITableViewCellDisplayAnimationBottom = 2,
    UITableViewCellDisplayAnimationRight = 3,
    UITableViewCellDisplayAnimationTopTogether = 4, // together
    UITableViewCellDisplayAnimationLeftTogether = 5,
    UITableViewCellDisplayAnimationBottomTogether = 6,
    UITableViewCellDisplayAnimationRightTogether = 7,
    UITableViewCellDisplayAnimationFadeIn = 8, // fade in line by line
    UITableViewCellDisplayAnimationFadeInTogether = 9, // fade in together
};

如果这个Demo对你有帮助的话请给个star奥,谢谢大家 😊 !!!

tableview_display_animation's People

Contributors

pipedog avatar

Watchers

 avatar  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.