【问题标题】:how to know the direction of rotation of UIImage in iPhone如何知道 iPhone 中 UIImage 的旋转方向
【发布时间】:2010-05-24 10:04:09
【问题描述】:

我想在转动的方向上旋转 uiimage,我可以得到 touchesBegan 和 TouchesEnd 点之间的角度,但是我应该如何决定是顺时针旋转还是逆时针旋转? 请帮忙

【问题讨论】:

    标签: iphone uiimageview rotation


    【解决方案1】:

    获取设备的当前方向并根据需要旋转。

    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
    

    orientationUIDeviceOrientationLandscapeLeftUIDeviceOrientationLandscapeRight 如果设备是横向的。

    【讨论】:

    • 不,这不是我需要的方向转向。我需要将图像旋转到旋转的角度,但我会决定是向左还是向右旋转。
    • 对不起,我不明白你的问题。我不知道你是如何获得角度的,你想如何旋转图像(通过加速度计或触摸)以及有什么问题。
    • 我想在不旋转设备的情况下转动图像视图。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-05
    • 1970-01-01
    • 2013-01-29
    • 1970-01-01
    • 2010-11-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多