ActionBarCompat on Gingerbread fills whole screen
Asked Answered
I

6

6

So we've successfully stripped ActionBarSherlock from the Zappos app in favor of the new ActionBarCompat and it works great on Honeycomb+ but on Gingerbread the action bar expands to fill the whole screen and I cannot figure out why it's happening. We basically just changed all the themes/styles/references to ActionBarSherlock to be the equivalents in ActionBarCompat. Below is a screen shot of the issue. Anyone else run across this on GB and know of a fix? It's holding up a release for us :\

Icebreaker answered 29/7, 2013 at 19:20 Comment(1)
It looks like you have custom views in the actionbar. What happens when you set their height to wrap_content?Delanos
I
5

Alright so I figured it out finally... we had copied the appcompat source code as a library project rather than using the com.android.support:appcompat-v7:18.0.+ dependency in gradle. After switching to the dependency in gradle and removing the appcompat source from our project it works as intended now.

Icebreaker answered 29/7, 2013 at 19:57 Comment(1)
Any idea on the root cause for this issue? Removing the library project and adding as a maven-style artifact fixed my issue as well, but just wondering why that's the case.Card
S
0

Here's answer to the problem: http://gmariotti.blogspot.com.br/

It was just add this:

dependencies {
compile 'com.android.support:appcompat-v7:18.0.+'
}
Sphagnum answered 4/8, 2013 at 23:59 Comment(0)
L
0

I faced a similar problem where the actionbar filled the entire screen when I went from using ActionBar AppCombat to use ActionBarSherlock. In the value-v11 folder style.xml file. I had to remove the ActionBar Style there that inherit from the ActionBar appCombat.

Lippi answered 27/9, 2013 at 7:56 Comment(0)
W
0

I also had this problem. The issue was that my themes definitions for Gingerbread were pointing to a style that didn't exist.

I had this in values/themes.xml:

<item name="actionBarStyle">@style/mytheme_solid_ActionBar</item>

But this mytheme_solid_ActionBar was only defined in values-v11/styles.xml and values-v14/styles.xml.

I just had to add it to values/styles.xml so that Gingerbread devices would have a proper style defined for the action bar (which inherits from Widget.AppCompat.Light.ActionBar.Solid.Inverse).

Wrier answered 27/10, 2013 at 17:44 Comment(0)
F
0

My problem was the parent that my custom actionBarStyle was inheriting from.

<style name="AppTheme" parent="AppBaseTheme">
    <item name="actionBarStyle">@style/sfActionBar</item>
    <item name="android:actionBarStyle">@style/sfActionBar</item>
</style>

My custom style was originally:

<style name="sfActionBar" parent="Widget.Sherlock.ActionBar">...</style>

The change to get it to work on everything but Gingerbread was:

<style name="sfActionBar" parent="@android:style/Widget.ActionBar">...</style>

The correct modification:

<style name="sfActionBar" parent="@style/Widget.AppCompat.ActionBar">...</style>
Forepaw answered 9/12, 2013 at 18:17 Comment(0)
G
0

Once I had similar issue (Toolbar's color filled the whole screen on Gingerbread) and the solution was to remove android:clipChildren="false" from the Toolbar's parent view.

Giuliana answered 1/12, 2014 at 10:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.