0

Edit: (Camera roll == image gallery)

Right now I have an app with 2 view controllers, where 2nd is presented modally from 1st. What I want to do is to create something similar to what iOS default camera app does, swipe finger left to right and pan to bring in camera roll.

I am planning to create a scroll view and add both views side by side.

Currently there is no rotation support in 1st view controller, which is the camera. But in the 2nd screen, auto rotation is enabled for all orientations.

If I put both to a single scroll view, how should I go about implementing the shouldAutorotate methods in the 2 view controllers? View controllers are different, but both will be present at the same time in the memory)

I don't want to autorotate anything in camera screen, but I want autorotation when the camera roll is pulled in. Also while the scroll view visible content is camaera screen, and device is rotated, the camera roll part should rotate, so that panning finger from left to right brings in the camera roll in correct orientation.

I see an option, allow autorotation in both VC's, but set the camera screen views' positions according to the new origin such that it seems like nothing has been rotated.

Other option is to not allow autorotate while scroll view displays camera screen, and start allowing it when camera roll comes in. But then if I am in camera screen, I have to play with positions of scroll view and camera roll so that pan works correctly.

1st option seems to be better... but still not cool enough.

4

1 に答える 1

0

一部のビューコントローラーをモーダルに提示している場合、コントローラー階層が高くなり、このビューコントローラーはその時点で回転通知を受け取る唯一のコントローラーです。他のコントローラーは「聴覚障害者」です。アプリのデリゲートでもローテーション通知を受け取ることができます。カメラ ロールもモーダルで表示する必要があるため、2 つのビュー コントローラーに取り組む必要があります。

私があなただったら、ユーザーが画像ギャラリーの最後をスクロールしたときに、次のスワイプ ジェスチャでカメラ ロールが表示されます (写真を閲覧している間はカメラ ロールは必要ありません)。

于 2013-04-04T13:37:20.530 に答える