为了得到它在上面的照片显示的期望的结果......我recomand你的编程方法更好,那么厦门国际银行计算策略
我想你重新尝试使用“完成”按钮实施选取器操作表。我会参考使用segemnt控制,而不是使用工具栏。
使用下面的代码,你想显示选择器和完成按钮的操作表。
UIActionSheet *Example_Actionsheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
Ex_Picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 40, 0, 0)];
Ex_Picker.delegate = self;
Ex_Picker.showsSelectionIndicator = YES; // note this is default to NO
Example_Actionsheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[Example_Actionsheet addSubview:Bedroom_Picker];
[Example_Actionsheet showInView:self.view];
[Example_Actionsheet setBounds:CGRectMake(0, 0, 320, 485)];
UISegmentedControl *closeButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Done"]];
closeButton.momentary = YES;
closeButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f);
closeButton.segmentedControlStyle = UISegmentedControlStyleBar;
closeButton.tintColor = [UIColor blueColor];
[closeButton addTarget:self action:@selector(Close_method) forControlEvents:UIControlEventValueChanged];
[Example_Actionsheet addSubview:closeButton];
[Example_Actionsheet release];
,如果你想使用工具栏
pickerDateToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
pickerDateToolbar.barStyle = UIBarStyleBlackOpaque;
[pickerDateToolbar sizeToFit];
NSMutableArray *barItems = [[NSMutableArray alloc] init];
UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
[barItems addObject:flexSpace];
UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(DatePickerDoneClick)];
[barItems addObject:doneBtn];
[pickerDateToolbar setItems:barItems animated:YES];
并添加工具栏和选择器在actionsheet的子视图。
[aac addSubview:"Your toolbar"];
[aac addSubview:"Your picker"];
并设置动作表框。它完成与工具栏。
请多说明一下,你凭借这种配置获得了什么。 UIActionSheet通常用于按钮。它从按钮中滑入,向您展示如何进行特定任务的选项。 – 2012-08-06 05:54:23
我认为你只是为动画使用动作表。您应该编写简单的动画代码,而不是将选取器和工具栏添加到动作表中。 – Apurv 2012-08-06 05:56:59