Add android:screenOrientation="portrait"
to the activity in your manifest.
How do I disable gravity for my android app [duplicate]
-
21-09-2022 - |
Domanda
See I have this android app and I kinda designed it using absolute positioning of elements so when I turn my phone 90 degrees the look is completely messed up. How I do I force my app to not change the layout when I turn my phone !
Soluzione
Altri suggerimenti
The best bet in your situation is to probably only allow a portrait orientation. You can do this in your AndroidManifest.xml with the following definition;
<activity android:name="com.example.SampleActivity" android:screenOrientation="portrait" />
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow