博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
IOS-Create UIActionSheet 'otherButtons' by passing in array
阅读量:4550 次
发布时间:2019-06-08

本文共 750 字,大约阅读时间需要 2 分钟。

例子如下: NSMutableArray*buttonTitles =[NSMutableArray array]; if(condition1){
    [buttonTitles addObject:@"Do action 1"]; } if(condition2){
    [buttonTitles addObject:@"Do action 2"]; } if(condition3){
    [buttonTitles addObject:@"Do action 3"]; } if(condition4){
    [buttonTitles addObject:@"Do action 4"]; } [buttonTitles addObject:@"Cancel"]; UIActionSheet*actionSheet =[[[UIActionSheet alloc] initWithTitle: nil delegate: self cancelButtonTitle: nil destructiveButtonTitle: nil otherButtonTitles: nil] autorelease]; for(NSString*title in buttonTitles){
    [actionSheet addButtonWithTitle: title]; } [actionSheet setCancelButtonIndex:[buttonTitles count]-1];

转载于:https://www.cnblogs.com/tx8899/archive/2012/06/28/2567118.html

你可能感兴趣的文章
自定义定时组件
查看>>
2-素数打比表
查看>>
性能测试
查看>>
浅谈 Python 的 with 语句
查看>>
使用koa+angular+mysql 完成了一个企业站
查看>>
SQL使用范例
查看>>
转 SQL集合函数中利用case when then 技巧
查看>>
WEB ICON 的探讨
查看>>
[内核编程] 键盘过滤第一个例子ctrl2cap(4.1~4.4)汇总,测试
查看>>
Java读书笔记05 类与对象
查看>>
正则表达式语法 2
查看>>
c# winform 应用程序根据条件阻止窗口关闭
查看>>
转载:简单的php写入数据库类
查看>>
垂直居中的几种实现方法
查看>>
UILabel标签文字过长时的显示方式
查看>>
H5离线缓存机制-manifest
查看>>
比较:I/O成员函数getline() 与 get()(第二种用法)的用法异同
查看>>
201671010118 2016-2017-2《Java程序设计》 第十一周学习心得
查看>>
Get Sauce(状压DP)
查看>>
Office2007 升级到 office2010
查看>>