B4X:
Private Sub MakeViewBackgroundTransparent(View As B4XView, Alpha As Int)
Dim clr As Int = View.Color
If clr = 0 Then
Log("Cannot get background color.")
Return
End If
View.Color = Bit.Or(Bit.And(0x00ffffff, clr), Bit.ShiftLeft(Alpha, 24))
End Sub
Depends on: XUI (or jXUI or iXUI).
Example:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
MakeViewBackgroundTransparent(Label1, 50)
MakeViewBackgroundTransparent(Label2, 100)
MakeViewBackgroundTransparent(Label3, 150)
MakeViewBackgroundTransparent(Label4, 250)
End Sub