我从 iPhone/iPad 库中加载照片,大部分都是纵向模式,我想知道如何查看横向或纵向模式下的照片?
Use the imageOrientation
的财产UIImage
实例。它会返回给你其中之一these常数。
例子:
UIImage *image = // 从库加载
if (image.imageOrientation == UIImageOrientationUp) {
NSLog(@"portrait");
} else if (image.imageOrientation == UIImageOrientationLeft || image.imageOrientation == UIImageOrientationRight) {
NSLog(@"landscape");
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)