亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pickerviewcontroller.m

?? iphone開發
?? M
字號:
/*File: PickerViewController.mAbstract: The view controller for hosting the UIPickerView of this sample.Version: 1.7Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Inc.("Apple") in consideration of your agreement to the following terms, and youruse, installation, modification or redistribution of this Apple softwareconstitutes acceptance of these terms.  If you do not agree with these terms,please do not use, install, modify or redistribute this Apple software.In consideration of your agreement to abide by the following terms, and subjectto these terms, Apple grants you a personal, non-exclusive license, underApple's copyrights in this original Apple software (the "Apple Software"), touse, reproduce, modify and redistribute the Apple Software, with or withoutmodifications, in source and/or binary forms; provided that if you redistributethe Apple Software in its entirety and without modifications, you must retainthis notice and the following text and disclaimers in all such redistributionsof the Apple Software.Neither the name, trademarks, service marks or logos of Apple Inc. may be usedto endorse or promote products derived from the Apple Software without specificprior written permission from Apple.  Except as expressly stated in this notice,no other rights or licenses, express or implied, are granted by Apple herein,including but not limited to any patent rights that may be infringed by yourderivative works or by other works in which the Apple Software may beincorporated.The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NOWARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIEDWARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR INCOMBINATION WITH YOUR PRODUCTS.IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL ORCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTEGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/ORDISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OFCONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IFAPPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Copyright (C) 2008 Apple Inc. All Rights Reserved.*/#import "PickerViewController.h"#import "CustomPicker.h"#import "Constants.h"@implementation PickerViewController- (id)init{	self = [super init];	if (self)	{		// this title will appear in the navigation bar		self.title = NSLocalizedString(@"PickerTitle", @"");	}		return self;}// return the picker frame based on its size, positioned at the bottom of the page- (CGRect)pickerFrameWithSize:(CGSize)size{	CGRect screenRect = [[UIScreen mainScreen] applicationFrame];	CGRect pickerRect = CGRectMake(	0.0,									screenRect.size.height - kToolbarHeight - 44.0 - size.height,									size.width,									size.height);	return pickerRect;}#pragma mark #pragma mark UIPickerView#pragma mark- (void)createPicker{	pickerViewArray = [[NSArray arrayWithObjects:							@"John Appleseed", @"Chris Armstrong", @"Serena Auroux",							@"Susan Bean", @"Luis Becerra", @"Kate Bell", @"Alain Briere",							nil] retain];	// note we are using CGRectZero for the dimensions of our picker view,	// this is because picker views have a built in optimum size,	// you just need to set the correct origin in your view.	//	// position the picker at the bottom	myPickerView = [[UIPickerView alloc] initWithFrame:CGRectZero];	CGSize pickerSize = [myPickerView sizeThatFits:CGSizeZero];	myPickerView.frame = [self pickerFrameWithSize:pickerSize];	myPickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;	myPickerView.delegate = self;	myPickerView.showsSelectionIndicator = YES;	// note this is default to NO		// add this picker to our view controller, initially hidden	myPickerView.hidden = YES;	[self.view addSubview:myPickerView];}#pragma mark #pragma mark UIPickerView - Date/Time#pragma mark- (void)createDatePicker{	datePickerView = [[UIDatePicker alloc] initWithFrame:CGRectZero];	datePickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;	datePickerView.datePickerMode = UIDatePickerModeTime;		// note we are using CGRectZero for the dimensions of our picker view,	// this is because picker views have a built in optimum size,	// you just need to set the correct origin in your view.	//	// position the picker at the bottom	CGSize pickerSize = [myPickerView sizeThatFits:CGSizeZero];	datePickerView.frame = [self pickerFrameWithSize:pickerSize];		// add this picker to our view controller, initially hidden	datePickerView.hidden = YES;	[self.view addSubview:datePickerView];}#pragma mark #pragma mark UIPickerView - Custom Picker#pragma mark- (void)createCustomPicker{	customPickerView = [[CustomPicker alloc] initWithFrame:CGRectZero];	customPickerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;		// note we are using CGRectZero for the dimensions of our picker view,	// this is because picker views have a built in optimum size,	// you just need to set the correct origin in your view.	//	// position the picker at the bottom	CGSize pickerSize = [myPickerView sizeThatFits:CGSizeZero];	customPickerView.frame = [self pickerFrameWithSize:pickerSize];		customPickerView.showsSelectionIndicator = YES;		// add this picker to our view controller, initially hidden	customPickerView.hidden = YES;	[self.view addSubview:customPickerView];}- (void)showPicker:(UIView *)picker{	// hide the current picker and show the new one	if (currentPicker)	{		currentPicker.hidden = YES;		label.text = @"";	}	picker.hidden = NO;		currentPicker = picker;	// remember the current picker so we can remove it later when another one is chosen}- (void)createButtonBar{	// create the button bar	buttonBar = [UIToolbar new];	buttonBar.barStyle = UIBarStyleBlackOpaque;		// position the button bar's frame	CGFloat toolbarHeight = kToolbarHeight + 4.0;	CGRect mainViewBounds = self.view.bounds;	[buttonBar setFrame:CGRectMake(CGRectGetMinX(mainViewBounds),								   CGRectGetMinY(mainViewBounds) + CGRectGetHeight(mainViewBounds) - (toolbarHeight * 2.0),								   CGRectGetWidth(mainViewBounds),								   toolbarHeight)];		// add a segmented control to the button bar	buttonBarSegmentedControl = [[UISegmentedControl alloc] initWithItems:									[NSArray arrayWithObjects:@"UIPicker", @"UIDatePicker", @"Custom", nil]];	[buttonBarSegmentedControl addTarget:self action:@selector(togglePickers:) forControlEvents:UIControlEventValueChanged];	buttonBarSegmentedControl.selectedSegmentIndex = 0.0;	// start by showing the normal picker	buttonBarSegmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;    buttonBarSegmentedControl.tintColor = [UIColor darkGrayColor];	buttonBarSegmentedControl.backgroundColor = [UIColor clearColor];	UIBarButtonItem *segItem = [[UIBarButtonItem alloc] initWithCustomView:buttonBarSegmentedControl];		buttonBar.items = [NSArray arrayWithObject:segItem];	[segItem release];		[self.view addSubview:buttonBar];		CGRect buttonBarFrame = [buttonBar frame];	CGRect segmentedControlFrame = CGRectMake(kLeftMargin,											  kTopMargin,											  buttonBarFrame.size.width - kLeftMargin,											  30.0);    buttonBarSegmentedControl.frame = segmentedControlFrame;		// start by showing the normal picker	buttonBarSegmentedControl.selectedSegmentIndex = 0.0;}	- (void)loadView{			CGRect screenRect = [[UIScreen mainScreen] applicationFrame];		// setup our parent content view and embed it to your view controller	UIView *contentView = [[UIView alloc] initWithFrame:screenRect];	contentView.backgroundColor = [UIColor blackColor];	contentView.autoresizesSubviews = YES;	contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth;		self.view = contentView;	[contentView release];		[self createPicker];		[self createDatePicker];	[self createCustomPicker];		[self createButtonBar];		// label for picker selection output, place it right above the picker	CGRect labelFrame = CGRectMake(	kLeftMargin,									myPickerView.frame.origin.y - kTextFieldHeight,									self.view.bounds.size.width - (kRightMargin * 2.0),									kTextFieldHeight);	label = [[UILabel alloc] initWithFrame:labelFrame];    label.font = [UIFont systemFontOfSize: 14];	label.textAlignment = UITextAlignmentCenter;	label.textColor = [UIColor whiteColor];	label.backgroundColor = [UIColor clearColor];	[self.view addSubview:label];		// create the segmented control to control the UIDatePicker's style (date/time/datetime)	pickerStyleSegmentedControl = [[UISegmentedControl alloc] initWithItems:										[NSArray arrayWithObjects:@"1", @"2", @"3", @"4", nil]];	[pickerStyleSegmentedControl addTarget:self action:@selector(togglePickerStyle:) forControlEvents:UIControlEventValueChanged];	pickerStyleSegmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;	pickerStyleSegmentedControl.tintColor = [UIColor darkGrayColor];    pickerStyleSegmentedControl.backgroundColor = [UIColor clearColor];	[pickerStyleSegmentedControl sizeToFit];	pickerStyleSegmentedControl.hidden = YES;		CGRect segmentedControlFrame = CGRectMake(kRightMargin,											  kTopMargin + kTextFieldHeight + 5,											  screenRect.size.width - (kRightMargin * 2.0),											  kSegmentedControlHeight);    pickerStyleSegmentedControl.frame = segmentedControlFrame;	[self.view addSubview:pickerStyleSegmentedControl];		// create the selection label for our UIDatePicker segmented control	labelFrame = CGRectMake(0,							kTopMargin,							self.view.bounds.size.width,							kTextFieldHeight);	segmentLabel = [[UILabel alloc] initWithFrame:labelFrame];    segmentLabel.font = [UIFont systemFontOfSize: 14];	segmentLabel.textAlignment = UITextAlignmentCenter;	segmentLabel.textColor = [UIColor whiteColor];	segmentLabel.backgroundColor = [UIColor clearColor];	segmentLabel.hidden = YES;	[self.view addSubview:segmentLabel];		// start by showing the normal picker	buttonBarSegmentedControl.selectedSegmentIndex = 0.0;}- (void)dealloc{	[pickerViewArray release];	[myPickerView release];	[datePickerView release];	[label release];	[customPickerView release];		[pickerStyleSegmentedControl release];	[segmentLabel release];		[buttonBarSegmentedControl release];	[buttonBar release];		[super dealloc];}- (void)togglePickerStyle:(id)sender{	UISegmentedControl *segControl = sender;	switch (segControl.selectedSegmentIndex)	{		case 0:	// Time		{			datePickerView.datePickerMode = UIDatePickerModeTime;			segmentLabel.text = @"UIDatePickerModeTime";			break;		}		case 1: // Date		{				datePickerView.datePickerMode = UIDatePickerModeDate;			segmentLabel.text = @"UIDatePickerModeDate";			break;		}		case 2:	// Date & Time		{			datePickerView.datePickerMode = UIDatePickerModeDateAndTime;			segmentLabel.text = @"UIDatePickerModeDateAndTime";			break;		}		case 3:	// Counter		{			datePickerView.datePickerMode = UIDatePickerModeCountDownTimer;			segmentLabel.text = @"UIDatePickerModeCountDownTimer";			break;		}	}		// in case we previously chose the Counter style picker, make sure	// the current date is restored	NSDate *today = [NSDate date];	datePickerView.date = today;}- (void)togglePickers:(id)sender{	UISegmentedControl *segControl = sender;	switch (segControl.selectedSegmentIndex)	{		case 0:	// UIPickerView		{			pickerStyleSegmentedControl.hidden = YES;			segmentLabel.hidden = YES;			[self showPicker:myPickerView];			break;		}		case 1: // UIDatePicker		{				// start by showing the time picker						// initially set the picker style to "time" format			pickerStyleSegmentedControl.selectedSegmentIndex = 0.0;			pickerStyleSegmentedControl.hidden = NO;			segmentLabel.hidden = NO;			[self showPicker:datePickerView];			break;		}			case 2:	// Custom		{			pickerStyleSegmentedControl.hidden = YES;			segmentLabel.hidden = YES;			[self showPicker:customPickerView];				break;		}	}}- (void)pickerAction:(id)sender{	if (myPickerView != currentPicker)		[self showPicker:myPickerView];}- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{	// if you want to only support portrait mode, do this	//return (interfaceOrientation == UIInterfaceOrientationPortrait);		return YES;}#pragma mark -#pragma mark PickerView delegate methods- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{	// report the selection to the UI label	label.text = [NSString stringWithFormat:@"%@ - %d",		[pickerViewArray objectAtIndex:[pickerView selectedRowInComponent:0]], [pickerView selectedRowInComponent:1]];}- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{	NSString *returnStr;	if (component == 0)	{		returnStr = [pickerViewArray objectAtIndex:row];	}	else	{		returnStr = [[NSNumber numberWithInt:row] stringValue];	}	return returnStr;}- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component{	CGFloat componentWidth;	if (component == 0)		componentWidth = 240.0;	// first column size is wider to hold names	else		componentWidth = 40.0;	// second column is narrower to show numbers	return componentWidth;}- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component{	return 40.0;}- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{	return [pickerViewArray count];}- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{	return 2;}#pragma mark UIViewController delegate methods// called after this controller's view was dismissed, covered or otherwise hidden- (void)viewWillDisappear:(BOOL)animated{	currentPicker.hidden = YES;		// restore the nav bar and status bar color to default	self.navigationController.navigationBar.barStyle = UIBarStyleDefault;	[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;}// called after this controller's view will appear- (void)viewWillAppear:(BOOL)animated{	[self togglePickers:buttonBarSegmentedControl];	// make sure the last picker is still showing		// for aesthetic reasons (the background is black), make the nav bar black for this particular page	self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;		// match the status bar with the nav bar	[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;}@end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲素人一区二区| 欧美揉bbbbb揉bbbbb| 丰满少妇久久久久久久| 久久不见久久见免费视频7| 国产精品自在在线| eeuss鲁一区二区三区| www国产成人| 日韩国产欧美在线观看| 欧美视频中文一区二区三区在线观看| 久久婷婷国产综合精品青草| 欧美bbbbb| 欧美精品电影在线播放| 一区二区在线电影| 成人18精品视频| 精品国产一区二区三区四区四| 视频一区免费在线观看| 欧美精品九九99久久| 日韩中文字幕1| 欧美精品久久99| 爽爽淫人综合网网站| 欧美日韩一区视频| 亚洲高清免费视频| 日韩欧美亚洲一区二区| 久久福利视频一区二区| 日韩美女在线视频| 亚洲福利一区二区| 欧洲生活片亚洲生活在线观看| 日本一区二区三区四区| 欧美熟乱第一页| 免费看黄色91| 国产免费久久精品| 欧美日韩国产区一| 国产一区二区三区四区在线观看| 国产精品热久久久久夜色精品三区| 成人av电影在线| 亚洲一区二区在线免费看| 欧美精品一区二区三| 成人黄色电影在线| 亚洲精品福利视频网站| 91精品国产麻豆国产自产在线| 精品一区二区免费| 一区二区三区在线影院| 精品国产一区二区国模嫣然| 99re这里只有精品6| 日韩精品欧美精品| 亚洲色图欧美激情| 精品美女一区二区| 欧美熟乱第一页| 成人深夜在线观看| 亚洲福利一二三区| 亚洲一区二区三区激情| 国产校园另类小说区| 欧美不卡视频一区| 日韩午夜激情视频| 日韩精品资源二区在线| 欧美乱熟臀69xxxxxx| 欧美中文字幕一二三区视频| 91精彩视频在线| 欧美日韩三级一区二区| 欧洲日韩一区二区三区| 在线一区二区三区四区五区| 97se亚洲国产综合自在线| 国产91丝袜在线观看| 成人黄色免费短视频| a美女胸又www黄视频久久| av在线不卡免费看| 欧美日韩mp4| 久久久噜噜噜久久人人看 | 日韩精品中文字幕一区 | 国产成人午夜精品影院观看视频 | 久久人人超碰精品| 中文久久乱码一区二区| 亚洲手机成人高清视频| 亚洲三级免费观看| 一区二区三区欧美| 亚洲va欧美va天堂v国产综合| 亚洲国产精品精华液网站| 亚洲成人福利片| 青青青伊人色综合久久| 9色porny自拍视频一区二区| 色综合久久久久综合| 精品国产sm最大网站免费看| 中文字幕在线播放不卡一区| 九一久久久久久| 91精品在线麻豆| 亚洲精品久久久久久国产精华液| 国内精品伊人久久久久av影院| 91小视频在线| 亚洲国产精品精华液2区45| 日本成人在线不卡视频| 欧美亚洲综合网| 亚洲视频在线一区| 国产在线国偷精品产拍免费yy| 91精品国产日韩91久久久久久| 中文字幕一区二区三区视频| 国产成人免费网站| 精品国产一二三区| 精品无码三级在线观看视频| 欧美一级一级性生活免费录像| 一区二区三区在线观看欧美| 99国内精品久久| 中文字幕巨乱亚洲| www.综合网.com| 亚洲黄色免费网站| 欧美在线视频全部完| 一区二区三区久久| 欧美日韩aaaaaa| 全国精品久久少妇| 久久久久久久久99精品| 成人开心网精品视频| 亚洲黄色在线视频| 91精品黄色片免费大全| 国产剧情在线观看一区二区| 国产色婷婷亚洲99精品小说| 成人黄页毛片网站| 亚洲免费在线播放| 欧美日韩免费视频| 香蕉加勒比综合久久| 久久久久久久性| 国模少妇一区二区三区| 欧美国产成人在线| 国产成人精品综合在线观看| 亚洲欧美自拍偷拍| 91国偷自产一区二区三区成为亚洲经典| 亚洲男人天堂一区| 日韩一级片在线播放| 国产成人免费在线观看不卡| 一区二区在线观看视频在线观看| 欧美精品丝袜中出| 成人午夜视频在线观看| 日本一不卡视频| 亚洲三级免费电影| 久久久99久久精品欧美| 欧美日韩一区二区在线观看视频| 亚洲国产精品一区二区www| 日韩免费在线观看| 日本精品视频一区二区| 久久电影国产免费久久电影| 亚洲三级小视频| 久久亚洲捆绑美女| 欧美综合一区二区| 国产成人av一区二区三区在线观看| 国产精品久久福利| 久久综合狠狠综合久久激情| 欧美午夜宅男影院| 91福利国产成人精品照片| 成人午夜大片免费观看| 久久成人免费电影| 国产主播一区二区| 国产不卡视频在线观看| 国产91在线观看丝袜| 一本色道久久综合亚洲精品按摩| 国产精品1区2区3区| 成人午夜在线免费| 国产成人免费av在线| 97se亚洲国产综合在线| 色婷婷香蕉在线一区二区| 成人免费毛片片v| 国产福利91精品一区| 成人午夜伦理影院| 蜜桃视频一区二区三区| 韩国中文字幕2020精品| 国产成人夜色高潮福利影视| 国产激情一区二区三区四区| www.66久久| 制服丝袜日韩国产| 欧美激情综合五月色丁香| 精品日韩一区二区三区免费视频| 久久亚洲一级片| 亚洲男人的天堂在线aⅴ视频 | 欧美一区国产二区| 国产亚洲1区2区3区| 亚洲人精品午夜| 精品亚洲欧美一区| 欧美亚洲一区二区在线观看| 日韩免费福利电影在线观看| 中文字幕一区二区5566日韩| 免费欧美在线视频| 一本大道久久a久久精二百| 精品国产成人系列| 亚洲欧美日韩电影| 午夜视频久久久久久| 卡一卡二国产精品 | 国产精品欧美久久久久一区二区| 国产精品久久久久久久岛一牛影视| 偷拍一区二区三区四区| 精品伊人久久久久7777人| 欧美主播一区二区三区美女| 久久日韩粉嫩一区二区三区| 一区二区三区视频在线看| 国产精品久久毛片| 久久精品国产亚洲5555| 欧美性生交片4| 亚洲精品国产高清久久伦理二区| 岛国av在线一区| 国产肉丝袜一区二区| 国产激情一区二区三区| 久久精品一区四区| 国产成人午夜精品影院观看视频 | 欧美xingq一区二区|