1
選擇標記顯示在小部件控制盤中彈出。我想在ios中使用正常的選擇標籤abd禁用該功能。檢查此鏈接以更好地理解我的意思:http://alvinalexander.com/iphone/iphone-ipad-html-select-widget-wheel。禁用ipad中的選擇控件輪並使用ipad中的正常選擇
選擇標記顯示在小部件控制盤中彈出。我想在ios中使用正常的選擇標籤abd禁用該功能。檢查此鏈接以更好地理解我的意思:http://alvinalexander.com/iphone/iphone-ipad-html-select-widget-wheel。禁用ipad中的選擇控件輪並使用ipad中的正常選擇
看到下面的代碼希望它會幫助你...享受代碼
-(void)showPicker{
UIToolbar *toolPicker = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
toolPicker.barStyle = UIBarStyleDefault;
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:@selector(hidePicker)];
[toolPicker setItems:[NSArray arrayWithObjects:cancelButton, nil]];
pickerCategory = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0, 44.0, 0.0, 0.0)];
pickerCategory.delegate=self;
pickerCategory.dataSource=self;
pickerCategory.showsSelectionIndicator = YES;
txtCategory.inputView=pickerCategory;
[pickerCategory addSubview:toolPicker];
CGRect thePickerFrame = pickerCategory.frame;
thePickerFrame.origin.y = toolPicker.frame.size.height;
[pickerCategory setFrame:thePickerFrame];
UIView *view = [[UIView alloc] init];
[view addSubview:pickerCategory];
[view addSubview:toolPicker];
UIViewController *vc = [[UIViewController alloc] init];
[vc setView:view];
[vc setContentSizeForViewInPopover:CGSizeMake(320, 260)];
popover = [[UIPopoverController alloc] initWithContentViewController:vc];
[popover presentPopoverFromRect:txtCategory.bounds inView:txtCategory permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
-(IBAction)hidePicker{
[popover dismissPopoverAnimated:YES];
}
您就可以在actionsheet撿拾工具.. –