我正在寫一個應用程序,用戶可以在庫中選擇一張照片,發送到服務器。 這是我的代碼iOS:如何在拍攝照片後在視圖之間切換?
-(IBAction)btnTakePictureClicked { UIImagePickerController* picker = [[UIImagePickerController alloc] init]; picker.delegate=self; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:picker animated:YES]; [picker release]; } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo{ [picker.parentViewController dismissModalViewControllerAnimated:YES]; self.imgTemp = image; // Where should these lines be? Send* send = [[Send alloc] initWithNibName:@"Send Email" bundle:nil]; [self presentModalViewController:send animated:YES]; [send release]; } - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { [picker.parentViewController dismissModalViewControllerAnimated:YES]; }
我預計,挑選照片後,它將改變發送頁面。但是,它仍然回到主頁。
這些行應該在哪裏?
Send* send = [[Send alloc] initWithNibName:@"Send Email" bundle:nil]; [self presentModalViewController:send animated:YES]; [send release];
它仍然回到頁面包含按鈕,從庫中加載。無論如何,感謝您的幫助。 –