How can I rotate an image in response to the iPhone's accelerometer?

后端 未结 2 1384
清歌不尽
清歌不尽 2021-01-13 22:22

hai , i use accelerometer to rotate uiimageview through device orientation like UIInterfaceOrientationLandscapeRight,etc. if i dont use device orientation,(if i put iphone

2条回答
  •  死守一世寂寞
    2021-01-13 23:20

    You could also use a combination of CGAffineTransforms on the view itself. These matrices act to transform a view by rotation or translations. You can even animate the process if you like. If this is what you're actually trying to do, I can provide some sample code.

提交回复
热议问题