I am just wondering if it is possible to customize the look and feel of the spinner view?
I have experimented with the following code and noted I can set the spinner background (using a ninepatch image).
If possible, I would also like to change the Selector-image and also the background color of the list shown (I think it is called PopUpBackground). Is this possible? If yes, may I kindly ask for a code-example.
Here are some links I found which deal with customizing a spinner. It seems that various XML-files are involved.
http://www.gersic.com/blog.php?id=57
http://stephenpengilley.blogspot.it/2013/01/android-custom-spinner-tutorial.html
Thanks.
I have experimented with the following code and noted I can set the spinner background (using a ninepatch image).
B4X:
Sub SetNinePatchDrawable(Control As View, ImageName As String)
Dim r As Reflector
Dim package As String
Dim id As Int
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")
id = r.GetStaticField(package & ".R$drawable", ImageName)
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
Control.Background = r.RunMethod2("getDrawable", id, "java.lang.int")
End Sub
If possible, I would also like to change the Selector-image and also the background color of the list shown (I think it is called PopUpBackground). Is this possible? If yes, may I kindly ask for a code-example.
Here are some links I found which deal with customizing a spinner. It seems that various XML-files are involved.
http://www.gersic.com/blog.php?id=57
http://stephenpengilley.blogspot.it/2013/01/android-custom-spinner-tutorial.html
Thanks.