Can anyone tell how to hide the app title bar in Pager fragment.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This should be enough:
ActionBar bar = getActionBar(); // you might need to use getSupportActionBar() based on your project setup
bar.setDisplayShowTitleEnabled(false);
bar.setDisplayShowHomeEnabled(false);
回答2:
Warren is correct. And if you want to hide it in your theme, you can do it by inheriting from a theme that does not display it:
For pre-Honeycomb styles:
<style name="HiddenActionBar" parent="@android:style/Theme"> </style>
For Honeycomb+:
<style name="HiddenActionBar" parent="@android:style/Theme.Holo.NoActionBar"> </style>
I personally prefer this method because it frees your classes from UI-related code and can easily be set for every Activity
by changing the theme of your application in the manifest.