第一个我配合 NoActionBar 的主题配合才有效 ^-^ ,其余两种仅仅记录下来,我的测试没有生效
在Activity 中 的 setContentView之前执行:
requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏标题栏getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);//隐藏状态栏<activity android:name=".LauncherActivity" android:theme="@style/Theme.AppCompat.NoActionBar">在style.xml文件中定义theme(如果没有style.xml,在res/values目录下创建)
<resources> <style name="Theme.NoTitle_FullScreen"> <!--自定义主题名称--><item name="android:windowNoTitle">true</item> <item name="android:windowFullscreen">true</item> </style> </resources>直接在AndroidManifest.xml中需要全屏显示的Activity属性中添加
android:theme="@style/Theme.NoTitle_FullScree"新闻热点
疑难解答