I have a Samsung Note 8 tablet running android 4.1.2. I'm using B4A 2.52 currently. I have created a panel with 2 buttons in designer. For the buttons I have used .png images the same size as the buttons. They were created in photoshop. The panel with the two buttons are used for a widget. In the B4A designer app on the device the images display correctly. After compiling the code the buttons are just gray boxes but still function normally. I cannot figure out what to do to make the images display. Could this be related to the android 4.1.2 OS? Would updating to B4A 2.72 fix this problem? Should I just assign the images to the buttons in code instead? Help is always greatly appreciated.
I see now that I cannot use statelistdrawable for buttons in designer for widgets. Instead I used imageview for the buttons. This works out nicely to create buttons except I would like to be able to display a pressed state for these buttons. I decided to load new images that would display a pressed state for the buttons on imageview_click event. This works but is way to fast to even see the change of images. Is there a simple way to slow it down so the "pressed state" image is displayed a little longer before I change it back to the "un-pressed state" image.
Here is what I am doing. I can barely see the change of the images because they switch too fast. I would need a delay possibly for a few milliseconds.
Shoul
B4X:
Sub ImageView1_click
rv.SetImage("Imageview1",LoadBitmap(File.DirAssets,"BlankB.png"))
rv.UpdateWidget
rv.SetImage("Imageview1",LoadBitmap(File.DirAssets,"IN1.png"))
rv.UpdateWidget
Thanks, much I will give that a try. I was playing around with using beeper from the audio lib. I was setting it to a time to about 500 ms and a very low frequency that couldn't be easily heard and that worked good as a timer. But I'll try the timer method so I don't need to have to load an additional lib (audio) just for a delay.
hey guys,
I have the same problem but its harder than his...
I would do it with an Imageview but i can't export my Buttons as Images... Always there are some corners...
Is there a trick to export the Button Design as Image?
Erel should know...
Regards