Android Question spinner background color on huawei

Discussion in 'Android Questions' started by rboeck, Dec 11, 2018.

  1. rboeck

    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: Dec 11, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

    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):
    Code:
    CreateResourceFromFile(Macro, Themes.LightTheme)
     
  3. rboeck

    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.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    The solution is very simple. However why aren't you making the change as I suggested?
     
  5. rboeck

    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.

    Code:
    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: Dec 11, 2018
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice