UIActionSheet用法
//上拉菜单
1 UIActionSheet* sheet = [[UIActionSheet alloc]
initWithTitle:nil
delegate:self
cancelButtonTitle:@"取消"
destructiveButtonTitle:@"确定"
otherButtonTitles:@"拍照",@"选择本地照片",nil];
[sheet showInView:self.view]; (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == ) {
[self showAlert:@"拍照"];
}else if (buttonIndex == ) {
[self showAlert:@"选择本地照片"];
}else if(buttonIndex == ) {
[self showAlert:@"取消"];
}else if(buttonIndex == ) {
[self showAlert:@"确定"];
} }
- (void)actionSheetCancel:(UIActionSheet *)actionSheet{ }
-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ }
-(void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex{ }
[self showAlert:@"拍照"]; 3 //弹出对话框
- (void)showAlert:(NSString *)message{
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:nil
message:message
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil]; [alertView show];
}
UIActionSheet用法的更多相关文章
- BlocksKit初见:一个支持将delegate转换成block的Cocoa库
简介 项目主页: https://github.com/zwaldowski/BlocksKit BlocksKit 是一个开源的框架,对 Cocoa 进行了扩展,将许多需要通过 delegate 调 ...
- iOS开发之UIAlertView与UIAlertController的详尽用法说明
本文将从四个方面对IOS开发中UIAlertView与UIAlertController的用法进行讲解: 一.UIAlertView与UIAlertController是什么东东? 二.我们为什么要用 ...
- UIActionSheet的使用
UIActionSheet是在iOS弹出的选择按钮项,可以添加多项,并为每项添加点击事件. 为了快速完成这例子,我们打开Xcode 4.3.2, 先建立一个single view applicatio ...
- ios开发 <AppName>-Prefix.pch文件的用法详解
我们知道,每新建立一个工程,比如说HelloWord,在分类SupportingFiles里都会有一个以工程名开头-Prefix.pch结尾的文件,如HelloWord-Prefix.pch.对于这个 ...
- UIActionSheet和UIAlert
UIActionSheet: 首先,在.h文件中添加Protocol,(Protocol相当于Java中的interface) @interface ActionSheetViewController ...
- iOS学习之UIActionSheet的使用
UIActionSheet是在iOS弹出的选择按钮项,可以添加多项,并为每项添加点击事件. 为了快速完成这例子,我们打开Xcode 4.3.2, 先建立一个single view applicatio ...
- UIAlertView用法
1. 最简单的用法 UIAlertView*alert = [[UIAlertView alloc]initWithTitle:@"提示" message:@"这是一个简 ...
- UIAlertView及UIActionSheet 在ios8极其以下版本的兼容问题解决方案
本文转载至 http://www.aichengxu.com/view/35326 UIAlertView及UIActionSheet在ios8中被放弃,其功能将完全由UIAlertControlle ...
- ios之UIActionSheet
UIActionSheet是在IOS弹出的选择按钮项,可以添加多项,并为每项添加点击事件. 为了快速完成这例子,我们打开Xcode 4.3.2, 先建立一个single view applicatio ...
随机推荐
- Python: PS 图像调整--对比度调整
本文用 Python 实现 PS 里的图像调整–对比度调整.具体的算法原理如下: (1).nRGB = RGB + (RGB - Threshold) * Contrast / 255 公式中,nRG ...
- 63.note.js之 Mongodb在Nodejs上的配置及session会话机制的实现
转自:https://www.cnblogs.com/alvin_xp/p/4751784.html 1.第一步安装mongodb数据库,这直接官网下载,这里不介绍. 2.也可以使用npm实现直接下载 ...
- POJ 3175 枚举
思路: 枚举小数点前 的数是啥 判一判 复杂度是根号的-.. 注意精度!!!! //By SiriusRen #include <cmath> #include <cstdio> ...
- Excel 2013数据挖掘工具栏的介绍(二)
这里不多说,直接上干货! 上一篇博客是 下载安装与配置Excel 2013数据挖掘加载项(SQL Server 2012 SP1 + SQLServer2012_DMAddin.msi) Excel ...
- C/C++(指针数组)
指针数组 指针数组的本质是数组,数组指针的本质是指针 一个数组中的各个元素都是字符指针,即为字符指针数组,或者指针数组. int arr[] = {1,2,23,45,6};//整形数组 char c ...
- NOI2017整数
NOI2017 整数 题意: 让你实现两个操作: 1 \(a\) \(b\):将\(x\)加上整数\(a \cdot 2 ^ b\),其中 \(a\)为一个整数,\(b\)为一个非负整数 2 \( ...
- vue 遇到的报错
[Vue warn]: Invalid default value for prop "dataParams": Props with type Object/Array must ...
- spring boot 热启动
spring boot热启动有两种方式 1. 以Maven插件的形式去加载,所以启动时使用通过Maven命令mvn spring-boot:run启动,而通过Application.run方式启动的会 ...
- 小米开源文件管理器MiCodeFileExplorer-源码研究(7)-Favorite收藏管理和SQLite数据库CRUD
FavoriteDatabaseHelper,存储favorite数据,到SQLite数据库.SQLiteOpenHelper是一个帮助管理数据库和版本的工具类.通过继承并重载方法,快速实现了我们自己 ...
- fragment-实例创建跟使用
今天接触到了fragment,在网上看到了它的使用方法.现在把它的创建跟使用记录下,方便以后查询. 1.创建一个自己的fragment,继承自fragment package com.android. ...