Android Question AppCompat Actionbar Color

nobbi59

Active Member
Licensed User
Longtime User
I am using the AppCompat Toolbar as an Actionbar.

Everything seems to work fine but i want to set its color at runtime. I am trying this by using the following code:

B4X:
Dim cd As ColorDrawable
cd.Initialize(Colors.Blue,0)
ActionBar.Background = cd

This changes the color but the Elevation is lost. And I cannot get it back by calling one of those methods:

B4X:
ActionBar.Elevation = 4dip
Dim ab as ACActionBar
ab.Elevation = 4

The ActionBar is added with the designer and is a ACToolBarLight.

I think the problem is that Im changing the color of the Base Panel, but idk what color i should change except that.
 

nobbi59

Active Member
Licensed User
Longtime User
Yes I did, but i want the user to be able to select the Color of the Actionbar and not give only 5 to 10 possibilities like I can do with a theme.
 
Upvote 0
Top