各种办法都试了:
- 方法一(无效)
requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); getWindow().addFlags(WindowManager.LayoutParams.TYPE_STATUS_BAR); setContentView(R.layout.screen_av); getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
- 方法二(无效)
<meta-data android:name="android.max_aspect" android:value="2.1" /> <activity android:name="ScreenAV" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > </activity>
都没用。真奇怪啊。
- 方法三(有效,真正实现了全屏)
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN); // View.SYSTEM_UI_FLAG_LAYOUT_STABLE:布局变化时状态栏位置会显示出来。