我想反轉我的UIImagePickerController,以便它能夠填充iPhone 5的屏幕,顯然,被倒置。這裏是我對UIImagePickerController的代碼:UIImagePickerController不旋轉和翻譯/縮放
- (void)applicationDidBecomeActive
{
UIImagePickerController *imageViewPickerController = [[UIImagePickerController alloc] init];
imageViewPickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imageViewPickerController.showsCameraControls = NO;
imageViewPickerController.cameraViewTransform = CGAffineTransformMakeRotation(DEGREES_RADIANS(180));
imageViewPickerController.cameraViewTransform = CGAffineTransformMakeTranslation(0.0, 71.0);
imageViewPickerController.cameraViewTransform = CGAffineTransformScale(imageViewPickerController.cameraViewTransform, 1.333333, 1.333333);
[self presentViewController:imageViewPickerController
animated:NO
completion:NULL];
}
如果我運行此代碼,我沒有得到任何倒置。如果我修改它,如下所示:
- (void)applicationDidBecomeActive
{
UIImagePickerController *imageViewPickerController = [[UIImagePickerController alloc] init];
imageViewPickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imageViewPickerController.showsCameraControls = NO;
imageViewPickerController.cameraViewTransform = CGAffineTransformMakeTranslation(0.0, 71.0);
imageViewPickerController.cameraViewTransform = CGAffineTransformScale(imageViewPickerController.cameraViewTransform, 1.333333, 1.333333);
imageViewPickerController.cameraViewTransform = CGAffineTransformMakeRotation(DEGREES_RADIANS(180));
[self presentViewController:imageViewPickerController
animated:NO
completion:NULL];
}
它反轉,但只佔用了屏幕的320×320平方,不顧我的其他轉換。如果任何人都可以藉助一些專業知識來了解如何讓它遵循所有這些論點,我將不勝感激。
CGAffineTransformMakeTranslation不是爲 – Alena
在iOS版2中添加CGAffineTransformMakeTranslation iOS 6的工作有沒有機會有別的東西,是這個問題? – alex
可能是我的答案http://stackoverflow.com/a/23893665/989896會幫助你。 – Alena