Git Product home page Git Product logo

ccactionsheet's Introduction

CCActionSheet

CCActionSheet有两种形式的list

####下图为其一:只显示文字,处于中间位置。

####下图为其二:显示icon和文字,文字居左对齐。

####下面是一种特殊的显示方式,设置属性maxcount(显示的最高高度=maxcount*cellheight),其余滑动显示。

###模仿微信自定义actionSheet 实现样式是模仿微信自定义actionSheet实现的。相似度还是较高的QAQ。

###使用 ####你可以使用cocoapods,也可以手动下载CCActionSheet中的文件,引用头文件#import "CCActionSheet.h"

pod 'CCActionSheet', '~> 1.0.1'

回调方式使用了两种,这里只举例使用block回调。

初始化

CCActionSheet *sheet = [[CCActionSheet alloc] initWithTitle:@"这是CCActionSheet" clickedAtIndex:^(NSInteger index) {
    NSLog(@"selected: %ld",(long)index);
} cancelButtonTitle:@"取消" otherButtonTitles:@"我是第1个选择",@"我是第2个选择",@"我是第3个选择",@"我是第4个选择",@"我是第5个选择",@"我是第6个选择",@"我是第7个选择",nil];

设置样式

sheet.style = CCActionSheetStyleTextCenter;

设置显示最多cell数

sheet.maxCount = 5;

设置list形式下的icon,现在只能以字符串数组传入😄

sheet.iconImageNameArray = @[@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected",@"icon_connected"];

显示

[sheet show];

ccactionsheet's People

Contributors

maxmoo avatar

Watchers

James Cloos avatar Chenxiao Lu 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.