How to hide app title in action bar - android

i have an action bar scherlock where i want to show logo without app title. I've just added in manifest android:logo tag and some code getSupportActionBar().setDisplayShowTitleEnabled(false) in my activity thats hide my title. It seems to work fine, but when app was started a title displays in a few seconds, how i can resolve this?

just try this in order to hide title bar.
Use this in styles.xml file
<style name="AppBaseTheme" parent="android:Theme.Light.NoTitleBar">

I suggest use custom title bar.
you can customize it as you like.
example
but use 45dip instead of 35dip

Related

White Space over notification area in Android Lollipop

We are having an application with three activities.
1) startup Activity which doesn't have any actionbar or navigation drawer (splash)
2) Main Activity with action bar
3) Another Activity with action bar
The theme is Theme.AppCompat.Light.NoActionBar
We are facing a strange issue on lollipop phone that white space is shown in notification area without any icons (completely blank) in startup activity and other activity. No issue on Kitkat or earlier phones.
Also, this problem is not encountered with MainActivity having Actionbar and navagation drawer
Any idea what could be wrong? will be happy to provide more details if requires.
You can see screenshot: http://imgur.com/1K9LbWi
This was the issue which somehow went into values-v21/styles.xml, removing it solved. Thanks all of you for answering.
<item name="android:navigationBarColor">#color/myNavigationColor</item>
Your status bar is in white color so you can not see any notification icon. Please change your status bar color with style.xml.
Open your style.xml and change color of colorPrimaryDark attribute.
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>

Change Action Bar Background

I'm trying to change the action bar color.
Does anyone knows how it's possible?
Thanks!!
Following Google page: https://developer.android.com/training/material/theme.html#ColorPalette
I added a style propriert inside my main theme:
<item name="colorPrimary">#6876c5</item>
and it did work!

Android: Tabbed Layout or Android Tabs without having an Action Bar?

So I created my app to have tabs on the action bar which direct to three fragment windows. I decided to change the theme of the app to "#android:style/Theme.Holo.Light.NoActionBar.Fullscreen" and suddenely my app started crashing with a nullpointer exception. After sometime I realized that the theme change, which disabled the action bar might have caused this.
Is there a way to implement tabbed layout without an action bar? A custom action bar? I badly want to use that theme. OR is there a way to customize the action bar: change the color or add custom icons and search function to make it more visually appealing?
Thank you!
Is there a way to implement tabbed layout without an action bar?
Use ViewPager and any one of several tabbed indicators, such as PagerTabStrip, the TabPageIndicator from the ViewPagerIndicator library, PagerSlidingTabStrip, etc.
Or, use FragmentTabHost.
is there a way to customize the action bar: change the color or add custom icons and search function to make it more visually appealing?
You are responsible for your own icons, so if you do not like your icons, talk to yourself about having yourself come up with better ones.
You can change the color of the action bar via a custom theme, such as one you might set up with Jeff Gilfelt's Action Bar Style Generator. Or, switch to using the appcompat-v7 edition of the action bar (with ActionBarActivity) and you can use a simpler custom theme where you just set some tint values.
as you have not provided code here i think you are using API 21 or less.. so you should change theme of your android application.
change styles.xml file as follows
<resources>
<!-- Base application theme. -->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
</style>

make android HomeAsUp icon disappear on demand

In my android app, in the Action Bar, next to the < image is an icon. I want to make it invisible/gone ondemand dynamically. How do I do that? The icon is actually defined as follows (this should help you realize where in the action bar I am talking about).
<style name="MyAppName.LogoTheme.LogoActionBar" parent="MyAppName.Theme.ActionBar">
<item name="android:displayOptions">showHome|homeAsUp</item>
<item name="android:icon">#drawable/my_icon</item>
I tried the following, but nothing.
this.getActionBar().setDisplayHomeAsUpEnabled(false);
this.getActionBar().setLogo(null);
this.getActionBar().setDisplayUseLogoEnabled(true);
In Java, call setDisplayShowHomeEnabled(false) and setDisplayShowTitleEnabled(false) on your ActionBar.

Custom Title bar with Holo Themes

Like a lot of people, I would like to use a custom title bar in android but also use the Holo theme. I've seen a lot of posts recommending using Theme.Holo.NoActionBar but it still gives me the same error as when I change my custom theme to use Theme.Holo. I want to resolve once and for all, is it possible to use a custom title bar like this:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title_bar);
which seems to be the most common way to do it.
Well you can create another element layout which looks like title bar for you and in the current activity you can set requestWindowFeature(Window.FEATURE_NO_TITLE)
This way you get the holo theme aswell as custom title. This is commonly used practice in this scenario.
you can define parent="#android:style/Theme.Holo"
then just disable the windows action bar
like this
<item name="android:windowActionBar">false</item>
in theme.
It's working for me...

Categories

Resources