UIImagePickerController has a black bar at the bottom by default?
I have an simple UIImagePickerController where I hide the camera controls and set the sourceType to the camera. This opens the live camera preview right away but there's about a 50px hight black bar at the bottom of the viewer. Any idea how to get rid of this?
Thanks Usman for the link. The ratio seems to be a bit different from what's suggested in the blog. The ratio of 1.23 works for iPhone 4 and 4s. Also, in order to preserve the aspect ratio, I suggest scaling both x and y.
picker = [[UIImagePickerController alloc] init];
picker.sourceType = sourceType;
picker.delegate = self;
picker.allowsEditing = NO;
picker.showsCameraControls = NO;
CGAffineTransform cameraTransform = CGAffineTransformMakeScale(1.23, 1.23);
picker.cameraViewTransform = cameraTransform;
我相信这是由于相机与iPhone屏幕的纵横比不同。
链接地址: http://www.djcxy.com/p/43302.html