开发者

UIImagePickerController - SourceType Camera - Allow taking photo only portrait orientation

I want to prevent use开发者_JS百科r from taking photo at the landscape orientation and allow only portrait. Is there a way you know to accomplish this?

Thanks in advance!


There are different things to consider here:

1) you want the camera button not to change for Landscape orientation (to indicate Portrait orientation only).You can achieve this by having custom controls and having your own Camera Control Bar.

camController.showsCameraControls = NO; // this will disable the default controls camController.cameraOverlayView = controlsView; // this view shows the required camera button in portrait only way.

2) Modifying the image data after capture

This is a tedious thing (already mentioned in many blogposts/stackoverflow)

UIImagePickerController camera preview is portrait in landscape app

Now rotate your image by 90 degrees (or 270 deg based on orientation) to make it look portrait.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜