I have a label with gray color text and transparent background. The label rests on top of an Imageview. Since the user can load any image and because the label background is transparent, the label text may not always be visible. One solution to this is to add a shadow to the text.
I believe Android allows this. There is a discussion at Stack Overflow:
Sub SetTextShadow(pView As View, pRadius As Float, pDx As Float, pDy As Float, pColor As Int)
Dim ref As Reflector
ref.Target = pView
ref.RunMethod4("setShadowLayer", Array As Object(pRadius, pDx, pDy, pColor), Array As String("java.lang.float", "java.lang.float", "java.lang.float", "java.lang.int"))
End Sub
A simple fix that works is to add a second label, below the main label, and with thext color in the color you want the shadow to have. Place it so that it's one pixel to the left and one pixel below the main label. Add the same text to that.
Not as neat, but it should work on all platforms.
Another solution, though different in effect, is to make sure the label is sized to just fit the text, and then have a semi-transparent background on the label. That way, you'll get an effect like TV subtitles.
Over time, I would love to see @Erel add these kinds of additional Android properties to B4A, so we can set them easily from the designer or our code without using reflection.