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

UIActinSheet和UIActionSheetDelegate的更多相关文章

  1. iOS开发系列--视图切换

    概述 在iOS开发中视图的切换是很频繁的,独立的视图应用在实际开发过程中并不常见,除非你的应用足够简单.在iOS开发中常用的视图切换有三种,今天我们将一一介绍: UITabBarController ...

  2. iOS-UI-UI控件概述

    以下列举一些在开发中可能用得上的UI控件: IBAction和IBOutlet,UIView 1 @interface ViewController : UIViewController 2 3 @p ...

  3. iOS之设置头像(访问系统相册、本地上传)

    1. UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:                               ...

  4. 【代码笔记】iOS-图片手势,上传照片

    代码: RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController : UIViewControl ...

  5. IOS 图片上传处理 图片压缩 图片处理

    - (void)initActionSheet { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil dele ...

  6. IOS网络第五天 AFN-02-文件上传,底部弹出窗体,拍照和相册获取图片上传

    ************** #import "HMViewController.h" #import "AFNetworking.h" @interface ...

  7. iOS 自定义选项卡-CYLTabBarController

    正常的选项卡流程 cocoapods就不说了 创建一个CYLTabBarControllerConfig类 #import <Foundation/Foundation.h> #impor ...

  8. UIImagePickerControllerDelegate---ActionSheet---获得设备型号

    <pre name="code" class="java">//IOS主要用的是UIImagePickerControllerDelegate这个事 ...

  9. iOS学习笔记——iOS高级控件

    UITableView UITableView的样式有两种,一种是Grouped(左图),另一种是Plain(右图),如下图,它的属性是style,类型为UITableViewStyle,枚举值分别是 ...

随机推荐

  1. js中元素操作的有关内容与对比

    以下 A:代表原生js B:代表jQuery 1 创建元素/节点 A: 元素节点- createElement( ) 文本节点 - createTextNode() 例如: var a = docum ...

  2. 【原】EF简单使用

    /// <summary> /// 数据上下文对象 /// </summary> static TestEntities te = new TestEntities(); st ...

  3. setcookie,getcookie,delcookie,setpostBgPic

    function setCookie(name,value) { var Days = 365; //此 cookie 将被保存 30 天 var exp = new Date(); //new Da ...

  4. $.ligerDialog 操作

    //关闭 $.ligerDialog.open 打开的弹窗 frameElement.dialog.close(); //关闭父窗口 parent.$.ligerDialog.close(); //关 ...

  5. JavaScript 常用方法总结

    经常使用的 JS 方法,今天记下,以便以后查询 /* 手机类型判断 */ var BrowserInfo = { userAgent: navigator.userAgent.toLowerCase( ...

  6. php-fpm.conf 文件详解

    pid string PID文件的位置. 默认为空. error_log string 错误日志的位置. 默认: 安装路径#INSTALL_PREFIX#/log/php-fpm.log. log_l ...

  7. 十六、mysql 分区之 简单sql优化1

    .使用 show session status like '%Com_%'; 可以查看当前连接的各个sql的执行频率 show global status like '%Com_%'; 可以查看从上次 ...

  8. C# 将datatable 转换json

    public static string DataTableToJson(DataTable dt) { StringBuilder jsonBuilder = new StringBuilder() ...

  9. iOS 通览(一) - 技巧、特性及规范

    一.编译器特性 1.ARC. ARC是编译器特性.项目中使用了ARC,编译器会在项目编译的时候自动添加OC对象计数器release代码.并且使用了ARC,项目中将不允许出现release.retain ...

  10. Controlling Site Provisioning Process with a Custom Provider

    http://www.cnblogs.com/frankzye/archive/2010/09/07/1820346.html http://sujoysharepoint2010.blogspot. ...