Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show only tabs using actionBarSherlock

I'm building an application using actionbarSherlock, and i'm using tabs in one of my actives. Is it possible to show only the tabs and hide the bar ?

In the left is how it's actually displayed and in the right it's how i would like to display

action_bar

like image 959
Guilherme Torres Castro Avatar asked Dec 02 '12 18:12

Guilherme Torres Castro


2 Answers

You need to set correct theme. In your manifest file, add this to your activity declaration:

android:theme="@android:style/Theme.NoTitleBar"

EDIT

You can hide titlebar from code as well. Add this to your activity's onCreate():

requestWindowFeature(Window.FEATURE_NO_TITLE);

EDIT 3

You could always create own style, derriving from sherlocks' and add disable of title bar. Like this

<style name="MyTheme" parent="Theme.Sherlock.Light.DarkActionBar">
   <item name="android:windowNoTitle">true</item>
</style>

and then make activity using MyTheme

like image 185
Marcin Orlowski Avatar answered Nov 19 '22 10:11

Marcin Orlowski


The solutions is :

ActionBar bar = getSupportActionBar();
bar.setDisplayShowTitleEnabled(false);  
bar.setDisplayShowHomeEnabled(false);
like image 4
Guilherme Torres Castro Avatar answered Nov 19 '22 10:11

Guilherme Torres Castro