- Home /
Is there a way to disable the rotating black border when rotating the iphone?
Since my iOS game is played only in portrait mode, I don't see any reason for the accelerometer to work (and consume energy). Plus, whenever I rotate the device, I see this black border that rotates to the new orientation, which is a bit annoying.
So, is there a way to disable the accelerometer?
Answer by Ashkan_gc · May 15, 2011 at 09:04 AM
there is no way to disable accelerametor using unity's api and i don't know about the apple objective c one. but i think it's the hardware that always works and cosume power if you want it or not. don't check and use it in your code.
about black borders i should say that they are possible to be disabled in code. you should just disable keyboard rotation. use iphoneKeyboard.autorotateX properties. there are different ones for different directions.
Answer by Eric5h5 · May 15, 2011 at 02:28 PM
Change the "#define kAccelerometerFrequency
" line in the AppController.mm file from 60 to 0. http://unity3d.com/support/documentation/Manual/iphone-Optimizing-MainLoop.html
Thanks Eric, I thought that what I wanted was disabling the accelerometer, but actually it was the iphone$$anonymous$$eyboard property that I was looking for. I found your answer very useful though :)
Your answer
Follow this Question
Related Questions
Player Movement in Apple TV 0 Answers
Accelerometer - accounting for gravity for arbitrary device angle 1 Answer
Loading disabled GameObject assets 0 Answers
adjust netural position accleromter 0 Answers
How to rotate your device and counter rotate camera 0 Answers