Android Question Image and text in a button

Justcooldev

Member
Licensed User
Hello,

I want to put an Image and text in 4 buttons in a panel
The image to the left and text (bold and size 17) centered in the remaining width of the button
Like that :

1650641661623.png


For example, my button (bt1) is sized with aspect ratio in my Panel (pnl3) and a margin (z) between the others buttons . Like this :

x = 100%x /100
y = 100%y /100
z = 6dip

pnl3.SetLeftAndRight (0 * x, 100 * x)
pnl3.SetTopAndBottom (30 * y, 100 * y)

bt1.SetLeftAndRight (((100 / 6) * x) + z, (100 * (5 / 6) * x) - z)
bt1.SetTopAndBottom (0 * y + z, (0.25 * 70) * y - z)


Can you please tell me how I can do to insert my images and text in each button

Thank you very much for your help :)
 

Justcooldev

Member
Licensed User
hello,

I'm sorry. But I'm a brand new B4A user.

I sent a request for help yesterday which has not yet been published.

Why ? Did I do something wrong?

Thank you for your help
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Your posts must be approved by a Moderator before being published because you are not a Licensed User.
This can delay your posts even by hours.
To become a Licensed User just make a donation to support the B4X development.
Here you can find the link to donate:
Donate for B4X
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I would add, use the forum search engine, it works very well.
In your particular case, search for custom views. @klaus has an entire chapter dedicated to them In his booklets
 
Upvote 0
Top