AHilberink Active Member Licensed User Longtime User May 25, 2021 #1 Hi, I am trying to put a transparant PNG at a Button and need the backgroudcolor of the button. I tried: B4X: Button1.Color=Colors.DarkGray Button1.SetBackgroundImage(LoadBitmapResize(File.DirAssets,"scales.png",pnlWeging.Height-3dip,pnlWeging.Height-3dip,True)).Gravity=Gravity.CENTER_HORIZONTAL+Gravity.TOP But the backgroudcolor is always white. Somebody can help? Kind regards, André
Hi, I am trying to put a transparant PNG at a Button and need the backgroudcolor of the button. I tried: B4X: Button1.Color=Colors.DarkGray Button1.SetBackgroundImage(LoadBitmapResize(File.DirAssets,"scales.png",pnlWeging.Height-3dip,pnlWeging.Height-3dip,True)).Gravity=Gravity.CENTER_HORIZONTAL+Gravity.TOP But the backgroudcolor is always white. Somebody can help? Kind regards, André
TILogistic Expert Licensed User Longtime User May 26, 2021 #2 It may be better to use this: How to add image to button with text ? Hello everyone how can i add image with text to the button like this ? www.b4x.com Upvote 0
It may be better to use this: How to add image to button with text ? Hello everyone how can i add image with text to the button like this ? www.b4x.com
Erel B4X founder Staff member Licensed User Longtime User May 26, 2021 #3 Both the color and the background image replace the view's drawable. This means that the color setting has no effect. My guess is that you are better using a Panel with an ImageView inside it. Upvote 0
Both the color and the background image replace the view's drawable. This means that the color setting has no effect. My guess is that you are better using a Panel with an ImageView inside it.
AHilberink Active Member Licensed User Longtime User May 26, 2021 #4 oparra said: It may be better to use this: How to add image to button with text ? Hello everyone how can i add image with text to the button like this ? www.b4x.com Click to expand... Erel said: Both the color and the background image replace the view's drawable. This means that the color setting has no effect. My guess is that you are better using a Panel with an ImageView inside it. Click to expand... Thank you both. Upvote 0
oparra said: It may be better to use this: How to add image to button with text ? Hello everyone how can i add image with text to the button like this ? www.b4x.com Click to expand... Erel said: Both the color and the background image replace the view's drawable. This means that the color setting has no effect. My guess is that you are better using a Panel with an ImageView inside it. Click to expand... Thank you both.