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;
}
}
}
UIActinSheet和UIActionSheetDelegate的更多相关文章
- iOS开发系列--视图切换
概述 在iOS开发中视图的切换是很频繁的,独立的视图应用在实际开发过程中并不常见,除非你的应用足够简单.在iOS开发中常用的视图切换有三种,今天我们将一一介绍: UITabBarController ...
- iOS-UI-UI控件概述
以下列举一些在开发中可能用得上的UI控件: IBAction和IBOutlet,UIView 1 @interface ViewController : UIViewController 2 3 @p ...
- iOS之设置头像(访问系统相册、本地上传)
1. UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle: ...
- 【代码笔记】iOS-图片手势,上传照片
代码: RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController : UIViewControl ...
- IOS 图片上传处理 图片压缩 图片处理
- (void)initActionSheet { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil dele ...
- IOS网络第五天 AFN-02-文件上传,底部弹出窗体,拍照和相册获取图片上传
************** #import "HMViewController.h" #import "AFNetworking.h" @interface ...
- iOS 自定义选项卡-CYLTabBarController
正常的选项卡流程 cocoapods就不说了 创建一个CYLTabBarControllerConfig类 #import <Foundation/Foundation.h> #impor ...
- UIImagePickerControllerDelegate---ActionSheet---获得设备型号
<pre name="code" class="java">//IOS主要用的是UIImagePickerControllerDelegate这个事 ...
- iOS学习笔记——iOS高级控件
UITableView UITableView的样式有两种,一种是Grouped(左图),另一种是Plain(右图),如下图,它的属性是style,类型为UITableViewStyle,枚举值分别是 ...
随机推荐
- FreeCodeCamp-JS基础部分
---恢复内容开始--- .pop() 将数组末尾的元素移除 var removedFromMyArray=myArray.pop() 将myArray数组的最后一个元素移除并 ...
- log4j定义某个类的日志级别
项目引入了定时任务后,当我把已有的定时任务删除后,控制台一直会打出类似于 [org.springframework.scheduling.quartz.LocalDataSourceJobStore] ...
- 【转】揭开Socket编程的面纱
对TCP/IP.UDP.Socket编程这些词你不会很陌生吧?随着网络技术的发展,这些词充斥着我们的耳朵.那么我想问: 1. 什么是TCP/IP.UDP?2. Sock ...
- 【原】从/dev/null重新打开标准输出
今天遇到一个程序,使用了printf输出中间的信息,我也懒得去改.由于此进程被其他进程fork之后,dup2 了标识输入输出到了/dev/null,再通过execvp装载进来.于是,为了看到输出的信息 ...
- c#winform,制作可编辑html编辑器
大神勿喷,新手记笔记 材料 网上下载kindeditor,动手在写个htmldome,图中的e.html.然后全部扔到了bin/debug下面,(x86是要扔到bin/x86/debug) 中间bod ...
- Android 控件收集
SwipeMenuExpandableListView https://github.com/tycallen/SwipeMenu-Expandable-ListView
- Get vertical scrollbar width and example
$.scrollbarWidth = function () { var parent, child, width; if (width === undefined) { parent = $('&l ...
- Couchbase上发布的关于NoSQL的技术论文
Couchbase是CouchDB与Membase两个NoSQL数据库相结合的产物,本文推荐的是Couchbase官方发表的一篇论文,命名为<NoSQL Database Technology& ...
- what is the virtual machine, when and why we need use it ?
虚拟机(Virtual Machine)指通过软件模拟的具有完整硬件系统功能的.运行在一个完全隔离环境中的完整计算机系统. 通过虚拟机软件,你可以在一台物理计算机上模拟出二台或多台虚拟的计算机,这些虚 ...
- linux标准输入输出重定向
command > filename 把标准输出重定向到一个文件,如果文件不存在则新建,如果存在则覆盖其内容.command >> filename 把标准输出重定向到一个文件中,如 ...