Android Question Labels instead of buttons!


Well-Known Member
Licensed User
Longtime User
I have the following problem:
I'm trying to set an image at the left of a button with text on it. I can't make it look correct to all screens, so I thought if it is right to use labels as buttons, because labels with reflection library can have an icon everywhere I want and keep their text!
Is my thought good?

I don't know if it is right, but I'm sharing this with you in case that is correct. Using the following code, I have gained the desired results:

Sub SetIconToButton(iBtn As Button,iBmp As BitmapDrawable,iL As Int,iT As Int,iW As Int,iH As Int)
    Dim ST As String
    Dim Lx As LabelExtras
    ST = ""
    Dim Rf As Reflector
    Rf.Target = iBtn
    Rf.RunMethod4("setCompoundDrawablesRelative",Array As Object(iBmp,Null,Null,Null),Array As String(ST,ST,ST,ST))
End Sub
Last edited: