nobbi59 Active Member Licensed User Longtime User Nov 29, 2017 #1 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: Code: Copy 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: Code: Copy 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.
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: Code: Copy 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: Code: Copy 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.
Peter Simpson Expert Licensed User Longtime User Nov 29, 2017 #2 Have you looked at setting up the colors in the theme.xml file or even easier the manifest editor instead of using ColorDrawable? Upvote 0
Have you looked at setting up the colors in the theme.xml file or even easier the manifest editor instead of using ColorDrawable?
nobbi59 Active Member Licensed User Longtime User Nov 29, 2017 #3 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
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.
Erel B4X founder Staff member Licensed User Longtime User Nov 30, 2017 #4 Check this: https://www.b4x.com/android/forum/threads/remove-material-action-bar-shadow.67640/#content Upvote 0
Check this: https://www.b4x.com/android/forum/threads/remove-material-action-bar-shadow.67640/#content