Note that there are some explanatory texts on larger screens.

plurals
  1. POUIPIckerView in UIActionSheet in a TabBarController
    primarykey
    data
    text
    <p>I am trying to create a UIPickerView inside of a UIActionSheet with a "done" button in a bar on the action sheet above the picker and I am trying to display the action sheet from the tab bar. </p> <p>here is the code I am using to create my picker:</p> <pre><code> _beepPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 0, 320, 216)]; _beepPicker.showsSelectionIndicator = YES; _beepPicker.dataSource = self; _beepPicker.delegate = self; </code></pre> <p>here is the code I am using to create my action sheet (with my "done" button)</p> <pre><code>_beepPickerActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; UISegmentedControl *doneButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Done"]]; doneButton.momentary = YES; doneButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f); doneButton.segmentedControlStyle = UISegmentedControlStyleBar; doneButton.tintColor = [UIColor blackColor]; [doneButton addTarget:self action:@selector(dismissBeepPicker:) forControlEvents:UIControlEventValueChanged]; [_beepPickerActionSheet addSubview:doneButton]; </code></pre> <p>and here is how I'm adding my "done" button:</p> <pre><code>[_beepPickerActionSheet addSubview:_beepPicker]; </code></pre> <p>and finally, here is how I am trying to display the action sheet:</p> <pre><code>[_beepPickerActionSheet showFromTabBar:self.tabBarController.tabBar]; </code></pre> <p>The Action Sheet does display... but, I can only see about 30 pixels of the top of the Action sheet????????</p> <p>Any idea what I may be doing incorrectly?</p> <p>When I check my debugger... here is what I see for the frame of the Action Sheet</p> <p>UIActionSheet: 0x6b304f0; frame = (0 455; 320 25);</p> <p>Screenshot before:</p> <p><img src="https://i.stack.imgur.com/sj35O.png" alt="enter image description here"></p> <p>Screenshot after:</p> <p><img src="https://i.stack.imgur.com/KjzAK.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload