一,效果图。

二,工程图。

三,代码。

RootViewController.h

#import <UIKit/UIKit.h>

@interface RootViewController : UIViewController
<UIActionSheetDelegate> @end

RootViewController.m

#import "RootViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
} - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
//点击任何处,出现选择框
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UIActionSheet *actionsheet=[[UIActionSheet alloc]initWithTitle:@"Choose Source" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Photo album",@"Default photo", nil];
[actionsheet showInView:self.view];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

【代码笔记】iOS-点击出现选择框的更多相关文章

  1. 百度编辑器UEditor 点击上传图片选择框会延迟几秒才会显示 反应很慢(转)

    转自:http://www.blogxuan.com/php/show/323.html UEditor 编辑器点击上传文件选择框会延迟几秒才会显示,反应很慢,上传图片选择框显示很慢. 1.uedit ...

  2. 【代码笔记】iOS-轮询弹出框

    一,效果图. 二,工程图. 三,代码. RootViewController.m #import "RootViewController.h" //加入弹出框的头文件 #impor ...

  3. CSS学习笔记四:下拉选择框以及其动画特效

    以前学的只是了解了css的一些基本属性,在做项目的时候都是直接使用bootstrap响应式来写项目,这样子很方便,很快捷,但是在自己看来还是有一点缺陷的,毕竟,我很多时候不怎么清楚它里面的具体运作.所 ...

  4. 【代码笔记】iOS-点击搜索按钮,或放大镜后都会弹出搜索框

    一, 效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> #import "CLHSearchBar.h ...

  5. 【代码笔记】iOS-点击顶点处,弹出另一个小的界面

    一,效果图. 二,文件目录. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @interface RootViewControlle ...

  6. 【代码笔记】iOS-点击任何处,出现城市

    一,效果图. 二,工程目录. 三,代码. //点击任何处,出现城市 -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { ...

  7. 【代码笔记】iOS-自定义弹出框

    代码: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [s ...

  8. 【代码笔记】iOS-忘记密码选择整体button

    一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @class BECheckBox; @interface ...

  9. 【代码笔记】iOS-点击城市中的tableView跳转到旅游景点的tableView,下面会有“显示”更多。

    一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController ...

随机推荐

  1. 【Swift学习】Swift编程之旅(二)

    在本节将介绍一些最基础的知识 swift提供自己版本的类型,下面说明几种简单的类型 Int 整型 Double和float 浮点型 String 字符串型 Bool 布尔型 它也提供了3种主要的强大的 ...

  2. nth-child和蝉原则实现的奇妙随机效果(译)

    此文翻译自charlotte jackson的<Magic randomisation with nth-child and Cicada Principle> 在做伪装的随机模式时将nt ...

  3. C#--访问修饰符

  4. C#--声明类

  5. C#读取配置文件的几种方式

    配置文件 <?xml version="1.0" encoding="utf-8" ?> <configuration> <con ...

  6. WCF快速上手

    需求:在同一台机子上,有一个B/S程序,和一个C/S程序(不要问为什么,事实就是这样),B/S程序需要主动和C/S程序通信(C/S程序主动与B/S程序通信的情况这里暂不讨论). 下面以最快的速度写一个 ...

  7. VB.NET WinForm获取运行程序用户名

    一个程序也许会被多个用户运行,如下: 那在VB.NET的WinForm环境下,怎样获取User Name呢?可从下面的方法: 代码: Public Shared Function GetProcess ...

  8. C# 委托和事件(一):最简单的委托和事件

    C#的事件基于委托,所以先说委托. 一切脱离实际场景的抽象概念新手看上去就像是在扯犊子,不错,我就是个新手.所以我需要一个实际的场景. 明天刚好考试(商务英语),考试上有两个角色(class):老师( ...

  9. SQL Server XML转Table

    前言 在SQL Server中有时候我们需要传人一个Table过去,然后可以在存储过程中批量更新,批量的获取相应数据. 但存储过程的参数是固定,所以这里我们可以变通的传人xml类型的参数,然后在存储过 ...

  10. Pydev Debugger not working with breakpoints

    I have a simple test module: print("fish")print("sticks")It runs pretty fast as ...