`
374016526
  • 浏览: 95503 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

iPhone 抽屉功能

阅读更多

    //

//  TestBedController_001.m

//  PDF_Reader

//

//  Created by mir on 11-4-15.

//  Copyright 2011 __MyCompanyName__. All rights reserved.

//

 

#import "TestBedController_001.h"

 

 

@implementation TestBedController_001

 

/*

 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {

    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {

        // Custom initialization

    }

    return self;

}

*/

 

/*

// Implement loadView to create a view hierarchy programmatically, without using a nib.

- (void)loadView {

}

*/

 

 

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.

- (void)viewDidLoad {

    [super viewDidLoad];

UISwipeGestureRecognizer *recognizer;

recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)];

[recognizer setDirection:(UISwipeGestureRecognizerDirectionRight)]; 

[[self view] addGestureRecognizer:recognizer]; 

[recognizer release]; 

recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; 

[recognizer setDirection:(UISwipeGestureRecognizerDirectionLeft)]; 

[[self view] addGestureRecognizer:recognizer]; 

[recognizer release]; 

recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; 

[recognizer setDirection:(UISwipeGestureRecognizerDirectionUp)]; 

[[self view] addGestureRecognizer:recognizer]; 

[recognizer release]; 

recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; 

[recognizer setDirection:(UISwipeGestureRecognizerDirectionDown)]; 

[[self view] addGestureRecognizer:recognizer]; 

[recognizer release];

}

//响应操作绑定的事件 

//Java代码 

- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer{ 

//UISwipeGestureRecognizerDirectionLeft UISwipeGestureRecognizerDirectionRight UISwipeGestureRecognizerDirectionUp UISwipeGestureRecognizerDirectionDown 

if (recognizer.direction==UISwipeGestureRecognizerDirectionLeft ) { 

NSLog(@"Left"); 

}

 

 

 

/*

// Override to allow orientations other than the default portrait orientation.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

    // Return YES for supported orientations

    return (interfaceOrientation == UIInterfaceOrientationPortrait);

}

*/

 

- (void)didReceiveMemoryWarning {

    // Releases the view if it doesn't have a superview.

    [super didReceiveMemoryWarning];

 

    // Release any cached data, images, etc that aren't in use.

}

 

- (void)viewDidUnload {

    [super viewDidUnload];

    // Release any retained subviews of the main view.

    // e.g. self.myOutlet = nil;

}

 

 

- (void)dealloc {

    [super dealloc];

}

 

 

@end


分享到:
评论

相关推荐

    左侧抽屉控制器的导航效果

    左侧抽屉控制器的导航效果,源码ICSDrawerController,ICSDrawerController 左侧抽屉控制器 包括所需要的基本功能 而且非常小巧 易于定制。 ICSDrawerController is a left-side drawer controller for iPhone (iOS...

    Andorid项目实例安卓源代码84套.zip

    Android 竖着的SeekBar 人员列表,聊天的实现,包括图片,语音 通讯录的开发_完整代码 Android_炫酷的3D音乐播放器_各种特效OpenGL Android多媒体 Android音视频的编解码 ...仿iphone的listview下拉更新

    JSDraw:尝试使用许多js-web抽屉

    Draw on mobile (like android device or iphone) Save the picture (expert image to base64(?)) Collection and reference I. zwibber 难用 有时用手机画会不顺 目前无法调整画面导致有一部分UI在网页外 II. ...

    滑轮:一个模仿iOS 10 Maps UI的库

    最大的变化是.compact的新displayMode可以在iPhone SE尺寸类设备上复制Apple Maps Behavior。 这是苹果地图抽屉的行为的翻版,为此当currentDisplayMode中的PulleyViewController是.compact那么唯一...

    android源码包集合4

    仿iphone 气泡短信 DEMO.rar 仿ireader书架.zip 仿QQ微信登录页面.rar 仿UCWEB界面源码.rar 仿优酷Android客户端图片左右滑动(自动滑动).rar 仿大众点评源码.rar 仿新版人人的效果.zip 传说中的3D播放器.rar 加载...

    Google Android SDK开发范例大全(第3版) 1/5

    3.15 如iPhone拖动相片特效 3.16 自制计算器 3.17 关于(About)程序信息 3.18 程序加载中,请稍候 3.19 全屏幕以按钮重写 3.20 今晚到哪儿打牙祭 3.21 Android变脸 3.22 打勾显示输入的密码 3.23 Android多语系支持 ...

    Google Android SDK开发范例大全(第3版) 4/5

    3.15 如iPhone拖动相片特效 3.16 自制计算器 3.17 关于(About)程序信息 3.18 程序加载中,请稍候 3.19 全屏幕以按钮重写 3.20 今晚到哪儿打牙祭 3.21 Android变脸 3.22 打勾显示输入的密码 3.23 Android多语系支持 ...

    Google Android SDK开发范例大全(第3版) 3/5

    3.15 如iPhone拖动相片特效 3.16 自制计算器 3.17 关于(About)程序信息 3.18 程序加载中,请稍候 3.19 全屏幕以按钮重写 3.20 今晚到哪儿打牙祭 3.21 Android变脸 3.22 打勾显示输入的密码 3.23 Android多语系支持 ...

    Google Android SDK开发范例大全(第3版) 5/5

    3.15 如iPhone拖动相片特效 3.16 自制计算器 3.17 关于(About)程序信息 3.18 程序加载中,请稍候 3.19 全屏幕以按钮重写 3.20 今晚到哪儿打牙祭 3.21 Android变脸 3.22 打勾显示输入的密码 3.23 Android多语系支持 ...

    google android sdk开发范例大全 第二版 PDF 光盘代码

     3.15 如iPhone拖动相片特效   3.16 自制计算器   3.17 关于(About)程序信息   3.18 程序加载中,请稍候   3.19 全屏幕以按钮重写   3.20 今晚到哪儿打牙祭   3.21 Android变脸   3.22...

    Google Android SDK开发范例大全(第3版)part2

     3.15 如iPhone拖动相片特效  3.16 自制计算器  3.17 关于(About)程序信息  3.18 程序加载中,请稍候  3.19 全屏幕以按钮重写  3.20 今晚到哪儿打牙祭  3.21 Android变脸  3.22 打勾显示输入的密码 ...

    《Google Android SDK开发范例大全(第3版)》.pdf

    3.15 如iphone拖动相片特效 54 3.16 自制计算器 56 3.17 关于(about)程序信息 58 3.18 程序加载中,请稍候 61 3.19 全屏幕以按钮重写 63 3.20 今晚到哪儿打牙祭 64 3.21 android变脸 67 3.22 ...

Global site tag (gtag.js) - Google Analytics