GithubHelp home page GithubHelp logo

chengkunblog / whactionsheetexample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iosweihui/whactionsheetexample

0.0 1.0 0.0 35 KB

自定义ActionSheet,可设置多种样式

Objective-C 100.00%

whactionsheetexample's Introduction

WHActionSheetExample

自定义ActionSheet,可设置多种样式

/*
 * 初始化 默认样式
 */
WHActionSheet *actionSheet = [[WHActionSheet alloc] initWithTitle:@"默认样式" sheetTitles:@[@"sheet1",@"sheet2",@"sheet3"] cancleBtnTitle:@"取消" sheetStyle:(WHActionSheetDefault) delegate:nil];

/*
 * 文字+图标样式 要为actionSheet的iconArr属性赋值
 */
/*
     WHActionSheet *actionSheet = [[WHActionSheet alloc] initWithTitle:@"图标+标题" sheetTitles:@[@"sheet1",@"sheet2",@"sheet3"] cancleBtnTitle:@"取消" sheetStyle:(WHActionSheetIconAndTitle) delegate:nil];
 */

/*
 * 图标样式 要为actionSheet的iconArr属性赋值
 */
/*
     WHActionSheet *actionSheet = [[WHActionSheet alloc] initWithTitle:@"图标" sheetTitles:nil cancleBtnTitle:@"取消" sheetStyle:(WHActionSheetIcon) delegate:nil];
 */

/*
 * 设置Sheet样式
 */
actionSheet.isCorner = YES;
actionSheet.titleColor = [UIColor greenColor];
actionSheet.titleHeight = 100;
actionSheet.titlebgColor = [UIColor yellowColor];
actionSheet.subtitlebgColor = [UIColor cyanColor];
actionSheet.subtitleColor = [UIColor blackColor];
actionSheet.canclebgColor = [UIColor greenColor];
actionSheet.cancleHeight = 80;

/*
 *传入图片数组
 */
UIImage *icon1 = [UIImage imageNamed:@"test01"];
UIImage *icon2 = [UIImage imageNamed:@"test02"];
UIImage *icon3 = [UIImage imageNamed:@"test03"];
actionSheet.iconArr = [NSMutableArray arrayWithObjects:icon1,icon2,icon3, nil];

/*
 * 设置代理 也可在初始化时设置代理
 */
actionSheet.delegate = self;

[actionSheet show];

whactionsheetexample's People

Contributors

iosweihui avatar

Watchers

James Cloos 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.