ActionBarCompat on Gingerbread fills the entire screen

So, we have successfully split ActionBarSherlock from the Zappos application in favor of the new ActionBarCompat, and it works great on Honeycomb +, but on Gingerbread the action bar expands to fill the entire screen, and I can’t understand why this is happening. We basically just changed all the themes / styles / links to ActionBarSherlock as equivalents in ActionBarCompat. Below is a screenshot. Does anyone else come across this in GB and know about the fix? This is liberation for us: \

+6
source share
6 answers

Ok, so I realized that ... we copied the appcompat source code as a library project, and did not use 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.

+5
source

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

This was just added:

dependencies { compile 'com.android.support:appcompat-v7:18.0.+' } 
0
source

I had a similar problem when the action bar filled the entire screen when I switched from using ActionBar AppCombat to using ActionBarSherlock. In the style-v11 folder, the style.xml file. I had to remove the ActionBar Style there, which inherits from the AppCombat ActionBar application.

0
source

I also had this problem. The problem was that my Gingerbread theme definitions pointed to a style that wasn't there.

I had it in values/themes.xml :

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

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

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

0
source

My problem was the parent that my custom actionBarStyle inherited 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 make it work on everything except Gingerbread was:

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

Correct modification:

 <style name="sfActionBar" parent="@style/Widget.AppCompat.ActionBar">...</style> 
0
source

As soon as I had a similar problem (the color of the toolbar filled the entire screen on Gingerbread), and the solution was to remove android:clipChildren="false" from the parent view of the toolbar.

0
source

Source: https://habr.com/ru/post/950572/


All Articles