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. OC7_复合类内存管理(setter方法)

    // // Person.h // OC7_复合类内存管理(setter方法) // // Created by zhangxueming on 15/6/18. // Copyright (c) 2 ...

  2. JavaScript学习笔记-数组(1)

    数组是值的有序集合.每个值叫做一个元素,而每个元素在数组中有一个位置,以数字表示,称为索引.JavaScript数组是无类型的:数组元素可以是任意类型,并且同一个数组中的不同元素也可能有不同的类型.数 ...

  3. javascript笔记——jqGrid 格式化时间列

    { name:'startTime', sortable:false, editable:true, width:300, sorttype:'date', //unformat:startTime, ...

  4. Bootstrap学习笔记(二) 表单

    在Bootstrap学习笔记(一) 排版的基础上继续学习Bootstrap的表单,编辑器及head内代码不变. 3-1 基础表单 单中常见的元素主要包括:文本输入框.下拉选择框.单选按钮.复选按钮.文 ...

  5. 小技巧:SystemTray中进行操作提示

    SystemTray中进行操作提示在wp中应用比较广泛,截图如下. 实现方法也十分简单 1.xaml代码中写入: shell:SystemTray.IsVisible="True" ...

  6. mysql安装启动教程(两种方法)

    mysql安装启动: 方法一(简单版): cmd进入mysql安装的bin目录:mysqld.exe –install net start mysql  服务启动(或者选择计算机->(右键)管理 ...

  7. hash桶

    #include <stdio.h> #include <stdlib.h> #include "chain.c" //include the chain. ...

  8. checkBox控件的CheckedChanged与CheckedStateChanged区别

    Checked属性为bool类型,CheckState属性为枚举类型(CheckState.Checked.CheckState.Unchecked和CheckState.Indeterminate) ...

  9. asp.net webform javascript postback JSON

    在弹出界面点击按钮触发后台的postback而不是刷新界面(保留已存在的搜索条件) function filterData() { var data = { col: $('#filterPopup' ...

  10. Cassandra1.2文档学习(13)—— 数据读取

    参考文档:http://www.datastax.com/documentation/cassandra/1.2/webhelp/index.html#cassandra/dml/dml_about_ ...