Android - 使导航栏消失
Android - Make Navigation Bar disappear
我已经搜索了一段时间,但找不到使导航栏在 android 应用程序中消失的方法。这是我来自 android studio
的资源
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar" >
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="AppTheme.CustomPop">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
</style>
和清单
<?xml version="1.0" encoding="utf-8"?>
<permission
android:name="com.example.....maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar"
android:label="@string/app_name"
>
<activity
android:name=".Class"
android:theme="@style/AppTheme.CustomPop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
我在这里得到了什么
我希望带有地图字符串的栏消失。
谢谢!
放置此行
requestWindowFeature(Window.FEATURE_NO_TITLE);
紧接着
super.onCreate(savedInstanceState);
在您的 Activity onCreate 方法中。
您可以使用标志隐藏或显示通知栏
隐藏 :
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
显示:
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
现在用于 actionBar :
隐藏 :
getSupportActionBar().hide();
显示:
getSupportActionBar().show();
我已经搜索了一段时间,但找不到使导航栏在 android 应用程序中消失的方法。这是我来自 android studio
的资源<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar" >
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="AppTheme.CustomPop">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
</style>
和清单
<?xml version="1.0" encoding="utf-8"?>
<permission
android:name="com.example.....maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar"
android:label="@string/app_name"
>
<activity
android:name=".Class"
android:theme="@style/AppTheme.CustomPop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
我在这里得到了什么
我希望带有地图字符串的栏消失。
谢谢!
放置此行
requestWindowFeature(Window.FEATURE_NO_TITLE);
紧接着
super.onCreate(savedInstanceState);
在您的 Activity onCreate 方法中。
您可以使用标志隐藏或显示通知栏
隐藏 :
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
显示:
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
现在用于 actionBar :
隐藏 :
getSupportActionBar().hide();
显示:
getSupportActionBar().show();