Search code examples
ioscocoa-touchapp-storeuipickerviewuiactionsheet

Is having a UIPickerView in a UIActionSheet acceptable?


Is it acceptable (aka would Apple consider it acceptable) to have a UIPickerView in a UIActionSheet?


Solution

  • Yes. It is acceptable.

    set the frame of the UIPickerView

    add the UIPickerView to the actionView

    As I remember, actionView will be full screen in this case

    UIActionSheet *actionView = [[UIActionSheet alloc] initWith...];
    UIPickerView *pickerView = [UIPickerView alloc] init...];
    pickerView.frame = CGRect(....);
    [actionView addSubview:pickerView];
    [pickerView release];
    [actionView showInView:theView]; 
    [actionView release];