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;
        }
    }
}

最新文章

  1. JAVA多线程售票问题
  2. MongoDB 由于目标计算机积极拒绝,无法连接 2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:10061
  3. CE STEPLDR
  4. python 学习笔记八 进程和线程 (进阶篇)
  5. 第三章 数组与字符串 UVa1588 Kickdown
  6. 【CodeForces 613B】Skills
  7. C++ Primer day 01
  8. CSS自学笔记(13):CSS3 2D/3D转换
  9. cocos2d-x 移植android竖,横屏设置
  10. 设置session超时
  11. css中的颜色
  12. 因PHP漏洞,超过4.5万个中国网站被攻击
  13. 【转】python 修改os环境变量
  14. ACM-ICPC 2018 沈阳赛区网络预赛 B Call of Accepted(表达式求值)
  15. Windows下面的常用的快捷键
  16. 记录:Ubuntu 18.04 安装 tensorflow-gpu 版本
  17. Java考试题之九
  18. Quartz(1)--框架简介
  19. RabbitMQ 最常用的三大模式
  20. sklearn特征选择和分类模型

热门文章

  1. java新手笔记31 集合实现类
  2. mysql 之路目录
  3. struts2.3.15.1 中jsp:include与jsp:forward的用法
  4. PHP缓冲区强制及时输出
  5. [大牛翻译系列]Hadoop(6)MapReduce 排序:总排序(Total order sorting)
  6. discuz X2.5自己写代码,获取当前登录的用户信息
  7. Linux网络通信编程(套接字模型TCP\UDP与IO多路复用模型select\poll\epoll)
  8. Wpf 简单制作自己的窗体样式(2)
  9. struts2与velocity的整合有两种方式
  10. EvnetBus