UIActinSheet和UIActionSheetDelegate
UIActinSheet和UIActionSheetDelegate
这个是就那个UIActionSheet对象 一般用来选择类型或者改变界面。。。还有更多应用
定义如下:
UIActionSheet *styleAlert = [[UIActionSheet alloc] initWithTitle:@"Choose a UIBarStyle:"
delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles: @"Default",
@"BlackOpaque",
@"BlackTranslucent",
nil,
nil];
// use the same style as the nav bar
styleAlert.actionSheetStyle = self.navigationController.navigationBar.barStyle;
//styleAlert.actionSheetStyle =UIActionSheetStyleAutomatic;
[styleAlert showInView:self.view];
[styleAlert release];
在委托里的操作代码如下:
- (void)actionSheet:(UIActionSheet *)modalView clickedButtonAtIndex:(NSInteger)buttonIndex
{
// Change the navigation bar style, also make the status bar match with it
switch (buttonIndex)
{
case 0:
{
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
break;
}
case 1:
{
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
break;
}
case 2:
{
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackTranslucent;
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
break;
}
}
}
最新文章
- JAVA多线程售票问题
- MongoDB 由于目标计算机积极拒绝,无法连接 2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:10061
- CE STEPLDR
- python 学习笔记八 进程和线程 (进阶篇)
- 第三章 数组与字符串 UVa1588 Kickdown
- 【CodeForces 613B】Skills
- C++ Primer day 01
- CSS自学笔记(13):CSS3 2D/3D转换
- cocos2d-x 移植android竖,横屏设置
- 设置session超时
- css中的颜色
- 因PHP漏洞,超过4.5万个中国网站被攻击
- 【转】python 修改os环境变量
- ACM-ICPC 2018 沈阳赛区网络预赛 B Call of Accepted(表达式求值)
- Windows下面的常用的快捷键
- 记录:Ubuntu 18.04 安装 tensorflow-gpu 版本
- Java考试题之九
- Quartz(1)--框架简介
- RabbitMQ 最常用的三大模式
- sklearn特征选择和分类模型
热门文章
- java新手笔记31 集合实现类
- mysql 之路目录
- struts2.3.15.1 中jsp:include与jsp:forward的用法
- PHP缓冲区强制及时输出
- [大牛翻译系列]Hadoop(6)MapReduce 排序:总排序(Total order sorting)
- discuz X2.5自己写代码,获取当前登录的用户信息
- Linux网络通信编程(套接字模型TCP\UDP与IO多路复用模型select\poll\epoll)
- Wpf 简单制作自己的窗体样式(2)
- struts2与velocity的整合有两种方式
- EvnetBus