-1

I am doing a compass and I dont want my uiimageview rotate when the user rotate the device. Is it possible to disable this?

Thanks you.

Thanh-Nhon Nguyen
  • 3,402
  • 3
  • 28
  • 41
  • its not possible to stop but, when your device rotate you can get the rotation angle and rotate your UIImageView into back state. – Retro Jul 03 '14 at 09:28
  • @Retro not sure what that means. But anyway, you need to explain what you want more. – Fogmeister Jul 03 '14 at 09:29

2 Answers2

1

OK, it took me a while to work out what you actually wanted.

Your question would be better phrased something like...

I'm trying to make a compass app. Using an image as the compass. Can I keep it pointing in the same direction when the user rotates the device.

The answer to this is yes.

You need to look at using the CoreMotion framework.

JUST A QUICK NOTE

By doing this you are not "preventing it from rotating". You are actually rotating the image on the screen to give the illusion that it is not rotating.

Fogmeister
  • 76,236
  • 42
  • 207
  • 306
-2

In your app settings -> General -> Deployment Info: Unmark what ever u want:

enter image description here

gran33
  • 12,421
  • 9
  • 48
  • 76
  • I think the question is not about device orientation but about creating a compass image that rotates to always point north. – Fogmeister Jul 03 '14 at 09:38