Android Question Spinner not responding to colordrawable

Discussion in 'Android Questions' started by ToolboxZX, Apr 24, 2017.

Similar threads

B4A Code Snippet SD: Spinner with CustomView
B4A Code Snippet Scrollbar Color
B4A Tutorial StateListDrawable example
B4A Code Snippet Custom Toast Message
B4A Tutorial [B4X] B4XPlusMinus - Spinner / wheel alternative
  1. ToolboxZX

    ToolboxZX Member Licensed User

    In what instance would a spinner not respond to a ColorDrawable?

    Consider the following code where a spinner "MySpinner" exists:
    Code:
    Dim cdw as Color Drawable
    cdw.Initialize2 (
    Colors.Transparent, 10,3,Colors.Red)
    MySpinner.Background = cdw
    Adding this code on 3 devices produces the desired result. A transparent background with a red border around the spinner. But on a Samsung GalaxyTab A it appears to ignore it completely. Android version is 6.0.1

    Is there a method for achieving the desired results?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The spinner uses an adapter to create the interfaces of the selected item and the list of items.
    You shouldn't replace the background drawable as it will be overridden by the adapter.
     
  3. ToolboxZX

    ToolboxZX Member Licensed User

    Understood. Is there any way to configure that adaptor then to apply a border to the spinner?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    No. It only allows changing the text color.
     
  5. ToolboxZX

    ToolboxZX Member Licensed User

    Understood. Thank you.
     
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