que estoy tratando de mostrar una UIActionSheet
en el IPAD con un UIPickerView
en ella, tengo el código equivalente de trabajo para el iPhone por lo que mi UIPickerView
delegado y cosas por el origen de datos de trabajo, pero en el iPad cuando uso -[UIActionSheet showFromRect:inView:animated:]
el resultado UIPopover
/UIActionSheet
es demasiado pequeño y parece que no puedo establecer el tamaño del marco, tampoco se muestran ninguno de los botones.UIActionSheet en el marco del iPad demasiado pequeño
No sé si esto se debe a que están fuera de los límites o si sucede algo más. Así es como se ve mi código después de haber eliminado todos los códigos no esenciales (iPhone, etc.). ¿Alguien sabe lo que estoy haciendo mal? ¿Alguien sabe de algún ejemplo?
CGRect thePickerFrame = CGRectMake(0, 0, 320.0, 485.0);
UIPickerView * thePickerView = [[UIPickerView alloc] initWithFrame:thePickerFrame];
[pickerActionSheet release], pickerActionSheet =
[[UIActionSheet alloc] initWithTitle:@"Choose" delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Next", nil];
thePickerView.showsSelectionIndicator = YES;
thePickerView.dataSource = self;
thePickerView.delegate = self;
[pickerActionSheet addSubview:thePickerView];
[thePickerView selectRow:0 inComponent:0 animated:NO];
[thePickerView release];
[pickerActionSheet showFromRect:currentTextField.bounds
inView:currentTextField animated:NO];
pickerActionSheet.frame = thePickerFrame;
Acabo de experimentar un poco para ver cuándo - [UIActionSheet setFrame:] se está llamando. Parece que después del bucle de evento, donde lo anterior se llama otro bucle de evento iniciado por el resultado de iOS, se llama a [UIActionSheet setFrame:] con el pequeño cuadro que se muestra. –
¿No estás mejor con popover en iPad con esta funcionalidad? AFAIK ActionSheet es solo para botones. – Eimantas