如何旋转我的应用程序180度旋转后,设备180度颠倒颠倒?我的、应用程序、设备

2023-09-05 04:06:36 作者:别勾引我ゝ我不近男色|▎

我已经开发了一个应用程序,并配置它的方向是横向所以它会一直显示在设备上的横向视图。

I have developed one application and configured its orientation is Landscape so it will always display on landscape view on the device.

现在我想将它旋转180度上下颠倒,当用户旋转设备180度颠倒,因此会相应地调整显示给用户properly.At present如果我旋转装置180度颠倒,我应用程序不按旋转所以它会反向显示(从底部到顶部)为例进行相应的调整:假设我的活动对底部顶部2文本字段和2个按钮,因此,如果您旋转设备180度上攻下来,活动不调整相应,所以用户可以看到在上面和文本字段按钮上底部这是错误的,应该调整/旋转具体根据设备的旋转和必须显示上底的顶部和按钮文本字段。

Now i want to rotate it 180 degree upside down when user rotate the device 180 degree upside down so it will adjust accordingly and displays to the user properly.At present if I am rotating device 180 degree upside down, My application doesn't adjust accordingly as per the rotation so it will display in reverse (from bottom to top) for example: suppose my activity is having 2 text fields on the top and 2 buttons on the bottom so if you rotate device 180 degree upside down, Activity is not adjusting accordingly, so user can see buttons on the top and text fields are on bottom which is wrong it should adjust/rotate as per the device rotation and must display text fields on the top and buttons on bottom.

请提供您宝贵的解决方案来解决这个问题。

Please provide your valuable solutions to resolve this problem.

问候, 皮克斯

推荐答案

说明:

安卓screenOrientation =sensorLandscape

android:screenOrientation="sensorLandscape"

在你的Andr​​oidManifest.xml中。这将改变景观和reverseLandscape之间的应用程序。

in your AndroidManifest.xml. This will transform application between landscape and reverseLandscape.