Android Question spinner background color on huawei

rboeck

Well-Known Member
Licensed User
Huawei.jpg I use a spinner on an android layout and have changed the background color. It works, but only on (some) huawei phones i get the effect, that only the with text filled part has this color, the rest is in white. On all other mobiles i have checked the whole control is filled with the back color.
What can i change? Current targeSdkVersion=28, theme= holo.light
 
Last edited:

Erel

Administrator
Staff member
Licensed User
Current targeSdkVersion=28, theme= holo.light
Two mistakes:

1. targetSdkVersion should be 26.

2. You should never use the holo theme.

If you want a light theme then add this line (and remove and other theme related line):
B4X:
CreateResourceFromFile(Macro, Themes.LightTheme)
 

rboeck

Well-Known Member
Licensed User
Strange result as side effect - i had this line in my manifest:
SetActivityAttribute(Main, android:theme, "@android:style/Theme.Holo.NoActionBar")

and changed it to:
SetActivityAttribute(Main, android:theme, "@android:style/Theme.Material.NoActionBar")

I also use SplashFade 1.02 as library to show a starting picture. When using material theme, i see the buttons from the layout behind in front of the splash screen, so my flash screen is partially destroyed. Switching back to holo theme my design works like i designed it.
 

Erel

Administrator
Staff member
Licensed User
The solution is very simple. However why aren't you making the change as I suggested?
 

rboeck

Well-Known Member
Licensed User
My design is based on NoTitleBar and NoActionBar - so i changed the word holo to material; when i remove both lines my current layout is destroyed.

B4X:
SetActivityAttribute(Main, android:theme, "@android:style/Theme.NoTitleBar.Fullscreen")
SetActivityAttribute(Main, android:theme, "@android:style/Theme.Material.NoActionBar")
I got the new problem after your suggested change, i dont unterstand, how to change the theme without destroying my current layout.

Finaly i changed from splash screen library to a panel using SetVisibleanimated and it works. Thanks!
 
Last edited:
Top