如何让程序的界面不翻转
请教各位,如何让程序的界面不随机器的重力感应而翻转
[解决办法]
<activity
android:screenOrientation="portrait">
</activity>
加上android:screenOrientation="portrait"
[解决办法]
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
这样也可以啊,我就这么做的。
[解决办法]
在android:screenOrientation属性中固定横屏或竖屏。