我的应用程序在启动时正确地全屏运行。然而,在最小化然后返回应用程序后,状态栏会弹出并将我的视图向下推一点。如何防止状态栏移动我的视图?
这是我的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.example.draw"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.example.draw.DrawView
android:id="@+id/draw"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="visible"
android:fitsSystemWindows="false"
/>
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"
android:layout_gravity="bottom"
/>
这是我活动的 onCreate 的一部分:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
我在清单中也有全屏主题:
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
谢谢