3

私のアプリケーションでは、写真をアップロードするための2つのオプションをユーザーに提供しています。

  1. 写真を撮る
  2. ライブラリから選択

この写真をデリゲートメソッドのmodalViewControllerで表示しています-imagePickerController:didFinishPickingImage editoringInfo:imageviewを使用してviewControllerを作成し、選択した画像をその中にロードします。

フォトライブラリの操作は問題ありませんが、カメラから写真を撮っているときに、写真を撮った後にデリゲートメソッドでmodalViewControllerを起動すると、ビューが約20ピクセル下にシフトします。その後、戻るたびにすべてのビューがシフトします。

編集:

    - (void)imagePickerController:(UIImagePickerController *)_picker1_ didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {

imageUploadView = [[UIViewController alloc]initWithNibName:nil bundle:nil];
imageUploadView.view.frame = CGRectMake(0, 0, 320, 480);
[imageUploadView.view setBackgroundColor:[UIColor blackColor]];
imageUploadView.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

image = [[UIImageView alloc]init];
image.frame = CGRectMake(0, 60, 320, 270);


   //I'm Adding different views like toolbar and barbuttons here

[_picker1_ presentModalViewController:imageUploadView animated:YES];

[image setImage:img];
   }

私は本当にここで立ち往生しています。

誰か助けてもらえますか?これは本当に緊急です。

よろしくお願いします。

4

1 に答える 1

3

modalViewcontrollerを表示する前にステータスバーを非表示にして、試してください。

于 2010-07-24T06:36:39.930 に答える