UIImagePickerController的默认比例是4:3,如果想要全屏的话,要对应的设置transform
Swift
let screenSize = UIScreen.mainScreen().bounds.size
let aspectRatio:CGFloat = 4.0/3.0
let scale = screenSize.height/screenSize.width * aspectRatio
self.imagePikerViewController.cameraViewTransform = CGAffineTransformMakeScale(scale, scale)
Objective C
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
float aspectRatio = 4.0/3.0;
float scale = screenSize.height/screenSize.width * aspectRatio;
self.imagePikerViewController.cameraViewTransform = CGAffineTransformMakeScale(scale, scale);
效果
stackoverflow这个问题链接
http://stackoverflow.com/a/31152178/3940672
那个leo就是博主我啦