Open Morpheus2002 opened 11 years ago
I'm adding a UIPickerView inside UIActionSheet, but it's not added. The Actionsheet is kinda bank.
Here is my code and screenshots for iOS7 and iOS6 (patched):
CGRect pickerFrame = CGRectMake(0, 42, 0, 0); musclegoupPickerView = [[UIPickerView alloc] initWithFrame:pickerFrame]; musclegoupPickerView.showsSelectionIndicator = YES; musclegoupPickerView.dataSource = self; musclegoupPickerView.delegate = self; UIToolbar *pickerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 100, 44)]; [pickerToolbar sizeToFit]; NSMutableArray *barItems = [[NSMutableArray alloc] init]; UIBarButtonItem *cancelBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonPressed:)]; [barItems addObject:cancelBtn]; UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil]; [barItems addObject:flexSpace]; UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneButtonPressed:)]; [barItems addObject:doneBtn]; [pickerToolbar setItems:barItems animated:YES]; MusclegroupPickerActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; [MusclegroupPickerActionSheet addSubview:pickerToolbar]; [MusclegroupPickerActionSheet addSubview:musclegoupPickerView]; [MusclegroupPickerActionSheet showFromTabBar:self.tabBarController.tabBar]; [MusclegroupPickerActionSheet setBounds:CGRectMake(0, 0, 320, 485)];
same problem :( I added a date picker and an uitoolbar inside an action sheet, then the sheet only display the date picker...
I solved the problem with this class: https://github.com/pkh/PKHPickerContainerView
I'm adding a UIPickerView inside UIActionSheet, but it's not added. The Actionsheet is kinda bank.
Here is my code and screenshots for iOS7 and iOS6 (patched):