Des mesures doivent être:
Créez votre préparateur.
Créez une vue vide avec l'arrière-plan clearColor.
Ajoutez votre textfield avec addSubview: à la vue à l'étape 2.
Set cameraOverlayView à la vue créée à l'étape 2.
Présentez votre préparateur.
Dans le code:
//self.picker and self.textField being your UIImagePickerController and UITextField instances.
emptyView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; //This frame will make it fullscreen...
emptyView.backgroundColor = [UIColor clearColor];
[emptyView setAlpha:1.0]; //I think it is not necessary, but it wont hurt to add this line.
self.textField.frame = CGRectMake(100, 100, self.textField.frame.size.width, self.textField.frame.size.height); //Here you can specify the position in this case 100x 100y of your textField preserving the width and height.
[emptyView addSubview:self.textField];
self.picker.cameraOverlayView = emptyView; //Which by the way is not empty any more..
[emptyView release];
[self presentModalViewController:self.picker animated:YES];
[self.picker release];
Je tapé le code ici moi-même il pourrait avoir une faute de frappe, espère que ça aide!
Un homme génial! travaillé comme un charme. Il suffit de changer "transparentColor" en "clearColor". – Louie
Code mis à jour, donc tout le monde peut l'utiliser. –