点一个Button让UIPickerView从下面弹出来是怎么做的
推荐于2016-03-13 · 知道合伙人数码行家
关注
展开全部
写一个方法
-(void) addPickerView {
if (pickerView == nil) {
pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 460, 320, 460)];
pickerView.delegate = self;
pickerView.dataSource = self;
pickerView.showsSelectionIndicator = YES;
[self.view addSubview:pickerView];
[pickerView release];
}
}
再用事件调用这个方法
[UIView beginAnimations: @"Animation" context:nil];
[UIView setAnimationDuration:0.3];
pickerView.frame = CGRectMake(0, 240, 320, 460);
[UIView commitAnimations];
-(void) addPickerView {
if (pickerView == nil) {
pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 460, 320, 460)];
pickerView.delegate = self;
pickerView.dataSource = self;
pickerView.showsSelectionIndicator = YES;
[self.view addSubview:pickerView];
[pickerView release];
}
}
再用事件调用这个方法
[UIView beginAnimations: @"Animation" context:nil];
[UIView setAnimationDuration:0.3];
pickerView.frame = CGRectMake(0, 240, 320, 460);
[UIView commitAnimations];
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询