Android Question How to add image to button with text ?

asales

Expert
Licensed User
Longtime User
CSBuilder:
B4X:
    Dim cs As CSBuilder
    cs.Initialize
    cs.Image(LoadBitmap(File.DirAssets, "myimage.png"), 40dip, 40dip, False).Append(CRLF).Append("Police")
    cs.PopAll
    btnImg.Text = cs
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
B4X:
    cs.Image(LoadBitmap(File.DirAssets, "myimage.png"), 40dip, 40dip, True)
    cs.Append(Chr(160))
    cs.VerticalAlign(-8dip)
    cs.Append("Police")

    cs.VerticalAlign(-8dip)
    cs.Append("Police")
    cs.Append(Chr(160))
    cs.Image(LoadBitmap(File.DirAssets, "myimage.png"), 40dip, 40dip, True)

cs.Image(LoadBitmap(File.DirAssets, "myimage.png"), 40dip, 40dip, True)

True = Baseline
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…