首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

UIActionSheet增添UIPickerView

2012-06-29 
UIActionSheet添加UIPickerView.From: http://tsyouaschen.iteye.com/blog/972683- (void)configurePicker

UIActionSheet添加UIPickerView.

From: http://tsyouaschen.iteye.com/blog/972683

- (void)configurePickersAndActionSheets {    CGRect pickerFrame;    if ((self.interfaceOrientation == UIInterfaceOrientationPortrait) ||        (self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)) {        pickerFrame = CGRectMake(0, 180, 0, 0);    } else {        pickerFrame = CGRectMake(0,180,480,200);    }    self.areaActionSheet = [[[UIActionSheet alloc] initWithTitle:@"Area" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Use",NULL] autorelease];    self.areaPicker = [[[UIPickerView alloc] initWithFrame:pickerFrame] autorelease];    self.areaPicker.delegate = self;    self.areaPicker.showsSelectionIndicator = YES;    [self.areaActionSheet addSubview:areaPicker];}
上面的代码就是横屏和纵屏的大小设置 
 if ((self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||        (self.interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {        [actionSheet setBounds:CGRectMake(0, 0, 480, 480)];    } else {        [actionSheet setBounds:CGRectMake(0, 0, 320, 618)];    }
此处用来设置actionsheet的大小  
具体的添加PickerView如下:
UIActionSheet?return?0;

}

热点排行