getSupportActionBar().hide() 支持 android 4.0 及以下版本吗?

does getSupportActionBar().hide() surport android 4.0 and below?

我使用以下代码在我的 android 应用程序中隐藏了我的操作栏

ActionBar actionBar = getSupportActionBar();
        actionBar.hide();

我想知道这是否会隐藏 android 手机 android 4.0 及以下版本的操作栏。谢谢

正在阅读 here,它将隐藏 android4.0

以下手机的操作栏

getSupportActionBar() is the same as getActionBar(), but comes from the Android Support library.Android Studio is recommending you switch to getSupportActionBar() because, if you did not, your application would not be backwards-compatible with previous versions of Android.

要确保隐藏您的操作栏,最简单的方法是让您的主题从 Theme.AppCompat.NoActionBar(或浅色变体)扩展。

是的。来自文档:

The ActionBar APIs were first added in Android 3.0 (API level 11) but they are also available in the Support Library for compatibility with Android 2.1 (API level 7) and above.

你可以阅读更多here