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,枚举值分别是 ...
随机推荐
- OC5_NSFileManger
// // main.m // OC5_NSFileManger // // Created by zhangxueming on 15/6/19. // Copyright (c) 2015年 zh ...
- In-App-Purcharse 官方原文摘要笔记
这并不是一篇关于 In-App-Purcharse 的专业深入分析文章,只是在初次浏览有关IAP官方文档后记录的一些需要注意的地方,就像是课堂笔记. 因为这是原版.并且涉及到支付的内容,所以就不翻译, ...
- css笔记——移动端
苹果手机 /*按钮样式:*/input[type=button], input[type=submit], input[type=file], button { cursor: pointer; -w ...
- jquery实现视觉滚动--fullpage
用fullpage.js实现视觉滚动效果 1.Html页面 <!DOCTYPE html> <html> <head> <meta charset=" ...
- Windows Phone使用sliverlight toolkit实现页面切换动画效果
使用应用时,好多app在页面切换的时候都有一个动画效果,感觉很炫,也大大增加了用户体验,怎么实现呢? 界面的切换,可以用Windows Phone Toolkit中的TransitionService ...
- jQueryr .on方法解析
.On() 其实.bind(), .live(), .delegate()都是通过.on()来实现的,.unbind(), .die(), .undelegate(),也是一样的都是通过.off()来 ...
- 思道OA PK 通达OA 同场竞技 谁与争锋
技术架构 思道OA 通达OA 开发语言 微软ASP.NET 4.0 PHP开源脚本语言 64位平台 64位 32位 数据库 SQL Server大数据库 MySQL开源数据库 官网下载 下载地址 下载 ...
- Spark小课堂Week3 FirstSparkApp(RDD开发)
Spark小课堂Week3 FirstSparkApp 问题:Java有哪些数据结构 大致有如下几种,其中List与Map是最重要的: List Map Set Array Heap Stack Qu ...
- Pandas之容易让人混淆的行选择和列选择
在刚学Pandas时,行选择和列选择非常容易混淆,在这里进行一下讨论和归纳 本文的数据来源:https://github.com/fivethirtyeight/data/tree/master/fa ...
- scrapy-redis使用详解
描述: 1.使用两台机器,一台是win10,一台是centos7,分别在两台机器上部署scrapy来进行分布式抓取一个网站 2.centos7的ip地址为192.168.1.112,用来作为redis ...