我从iPhone/iPad库加载照片,其中大部分都是在纵向模式下,我想知道如何在横向或纵向模式下查看照片?
Bjö*_*lek 12
使用实例的imageOrientation
属性UIImage
.它将返回这些常量之一.
例:
UIImage*image = //从库加载
if (image.imageOrientation == UIImageOrientationUp) {
NSLog(@"portrait");
} else if (image.imageOrientation == UIImageOrientationLeft || image.imageOrientation == UIImageOrientationRight) {
NSLog(@"landscape");
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
8467 次 |
最近记录: |