Remove shadow between Actionbar and Tab

My application uses its own style, which I created using the Android Action style generator (Style Compatibility = AppCombat). The color of the action bar and the tabs are the same, but the problem is that there is a shadow between them. How to remove this shadow?

<style name="MyAppTheme" parent="android:Theme.Holo.Light"> <item name="android:windowContentOverlay">@null</item> 

"android: windowContentOverlay" removes the shadow under the tab and not higher. enter image description here

+6
source share
6 answers

Well here is the solution of Audren Tissier , who worked for me:

This is because you are using drawable instead of color.look for something like this:

 <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"> <item name="android:background">@color/yourcolor</item> </style> 

Replace the popped color as above and it should go away.

+4
source

Use the property below in AppBarLayout

 app:elevation="0dp" 
+2
source

The shadow on the status bar is systemic and cannot be deleted, however the status bar you are referring to is inside Theme.Holo.Light. As far as I know, it cannot be deleted.

0
source

I hope I understood your question correctly, that is, you want to somehow combine the action bar with the tabs so that there is no border between them → the line or shadow you specified. If this is correct, then this is what you are looking for:

Add this to your MyAppTheme :

 <item name="android:actionBarStyle">@style/LineRemover</item> 

and change this line:

 <item name="android:windowContentOverlay">@null</item> 

:

 <item name="android:windowActionBarOverlay">true</item> 

and then add the following style below:

 <style name="LineRemover" parent="android:Widget.Holo.ActionBar"> <item name="android:background">@android:color/transparent</item> </style> 

In the end, you have something like this:

 <style name="MyAppTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:windowActionBarOverlay">true</item> <item name="android:actionBarStyle">@style/LineRemover</item> </style> <style name="LineRemover" parent="android:Widget.Holo.ActionBar"> <item name="android:background">@android:color/transparent</item> </style> 

I assume that you know that you should register your theme in the android manifest (in your activity or application tag:

  android:theme="@style/MyAppTheme" > 

Remember to mark this as your accepted answer, if that helped you :)

0
source

if you set the height of the inscription on the Remove.its tab, working fine

0
source

Use the code below in your snippet

  getSupportActionBar().setElevation(0); 
0
source

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


All Articles