PickerView新增確定,取消按鈕
txtfield點擊出現pickerview
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
if (txtField.tag
== 301)
{
[txtField
resignFirstResponder];
UIActionSheet
*actionSheet = [[UIActionSheet alloc] initWithTitle:@ ""
delegate: self
cancelButtonTitle: nil
destructiveButtonTitle: nil
otherButtonTitles: nil , nil ];
self .m_actionSheet
= actionSheet;
[actionSheet
release]; UIToolbar
*pickerDateToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
pickerDateToolbar.barStyle
= UIBarStyleBlackOpaque;
[pickerDateToolbar
sizeToFit];
NSMutableArray *barItems
= [[ NSMutableArray alloc]
init];
//
UIBarButtonItem
*cancelBtn = [[UIBarButtonItem alloc] initWithTitle:@ "取消" style:UIBarButtonItemStyleBordered
target: self action: @selector (toolBarCanelClick)];
[barItems
addObject:cancelBtn];
[cancelBtn
release];
//
UIBarButtonItem
*flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target: self
|