【代码笔记】iOS-UIActionSheet动态添加按钮
来源:互联网 发布:蓝月传奇官职升级数据 编辑:程序博客网 时间:2024/05/22 17:15
一,效果图。
二,代码。
RootViewController.h
#import <UIKit/UIKit.h>@interface RootViewController : UIViewController<UIActionSheetDelegate>@end
RootViewController.m
//点击任何处,弹出UIActionSheet-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UIActionSheet *sheet=[[UIActionSheet alloc]initWithTitle:@"标题" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil, nil]; // 逐个添加按钮(比如可以是数组循环) [sheet addButtonWithTitle:@"Item A"]; [sheet addButtonWithTitle:@"Item B"]; [sheet addButtonWithTitle:@"Item C"]; // 同时添加一个取消按钮 [sheet addButtonWithTitle:@"Cancel"]; sheet.cancelButtonIndex = sheet.numberOfButtons-1; [sheet showInView:self.view];}
阅读全文
0 0
- 【代码笔记】iOS-UIActionSheet动态添加按钮
- UIActionSheet动态添加按钮
- 动态添加UIActionSheet按钮
- 动态添加UIActionSheet按钮
- iPhone开发之动态添加UIActionSheet按钮
- iPhone开发之动态添加UIActionSheet按钮
- iOS: 学习笔记, 动态添加按钮
- iOS 动态添加按钮
- 【代码笔记】iOS-清除图片缓存UIActionSheet
- 【代码笔记】iOS-UIActionSheet字体的修改
- iOS开发:动态添加按钮
- IOS AlertView动态添加按钮
- iOS开发:动态添加按钮
- iOS 设置UIActionSheet 按钮颜色
- IOS项目笔记——按钮属性和代码添加
- IOS笔记 - UIActionSheet
- 动态添加UIActionSheet cancel button
- iOS开发1:动态添加按钮
- ROM、RAM、DRAM、SRAM和FLASH的区别
- 分针网—每日分享:MySQL全文索引应用简明教程
- json前后端处理,避免解析错误问题
- linux在命令行直接打开图形文件夹
- 开启win7家庭普通版的超级管理员账户Administroto
- 【代码笔记】iOS-UIActionSheet动态添加按钮
- MySQL Group Commit 组提交(BLGC)
- 【Java】XML文件读取到数据库
- 创建非循环链表
- 比特币系统的脚本(Script)——交易生成和验证的原理(第一部分)(初稿)*****
- 串口与SPI
- 页高速缓存
- Python基础概念_8_字符串处理
- ubuntu学习日记--Lesson5:系统目录详解