Coder Social home page Coder Social logo

tabcardview's Introduction

本文目录

  • 效果图
  • 使用方法
  • 实现说明

效果图

效果图.gif

使用方法

1. install

pod search TABCardView

2. 初始化

/**
 初始化方法

 @param frame 位置
 @param showCardsNumber 显示的卡片数
 @return TABCardView's object
 */
- (instancetype)initWithFrame:(CGRect)frame
              showCardsNumber:(NSInteger)showCardsNumber;
// 简单使用示例
self.cardView = [[TABCardView alloc] initWithFrame:CGRectMake(40, (kScreenHeight - 320)/2, kScreenWidth - 120, 320)
                                       showCardsNumber:4];
self.cardView.isShowNoDataView = YES;
self.cardView.noDataView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"占位图"]];
self.cardView.delegate = self;
[self.view addSubview:self.cardView];
  1. 刷新数据源
// 使用示例
[self.cardView loadCardViewWithData:array];
  1. 参数说明
  1. showCardsNumber 需要展示的卡片数
  2. isShowNoDataView 是否在没有数据时,显示卡片
  3. noDataView 没有数据时,显示的view
  4. offsetX 展示卡片的横坐标偏移量,默认为20,决定卡片堆叠方式
  5. offsetY 展示卡片的纵坐标偏移量,默认为0,决定卡片堆叠方式

说明

  1. 卡片组是一个view
  2. 卡片组由多个TABBaseCardView组成,你可以继承TABBaseCardView,定制自己的卡片内容,不只是一张图
  3. 代理目前的作用是:告诉你当前是哪个卡片

tabcardview's People

Contributors

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