Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

UIActionSheet with UIPickerView inside blank #116

Open
Morpheus2002 opened this issue Sep 30, 2013 · 2 comments
Open

UIActionSheet with UIPickerView inside blank #116

Morpheus2002 opened this issue Sep 30, 2013 · 2 comments
Labels

Comments

@Morpheus2002
Copy link

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)];

ios simulator bildschirmfoto 30 09 2013 14 15 49
ios simulator bildschirmfoto 30 09 2013 14 14 55

@zgnecah
Copy link

zgnecah commented Nov 23, 2013

same problem :(
I added a date picker and an uitoolbar inside an action sheet, then the sheet only display the date picker...

@Morpheus2002
Copy link
Author

I solved the problem with this class: https://github.com/pkh/PKHPickerContainerView

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants