Custom button can't show on android emulator

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Steven Meng
Posts: 4
Joined: Wed Mar 10, 2021 7:02 am

Custom button can't show on android emulator

Post by Steven Meng » Wed Mar 10, 2021 9:50 am

Hi Everyone, I met a problem, I just follow the lesson(how-to-create-a-rollover-button-with-icon-images) to make a custom button, it can't show in the android Emulator when i test it, and also can't show on the real mobile phone when I save as a standalone application .Is anybody knows the reason or met the similar problem?

BTW, why I can't insert a lessons link by BBCode? :?:

Best Regards

Steven Meng

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Custom button can't show on android emulator

Post by Klaus » Wed Mar 10, 2021 11:43 am

Hi Steven,

welcome to the forum!
Due to high spamming here, you need to have at least seven posting before you can post links BBCode etc.

You mean this lessons: https://lessons.livecode.com/m/4071/l/6 ... con-images?
Did you import your images? Menu: File: Import as control: Image file...
Missing images are mostly a path problem if they are only referenced.


Best

Klaus

Steven Meng
Posts: 4
Joined: Wed Mar 10, 2021 7:02 am

Re: Custom button can't show on android emulator

Post by Steven Meng » Wed Mar 10, 2021 3:58 pm

Hi Klaus

Thanks for your quickly reply. The link of your lessons is correct. The problem is solved.
The reason is : I used the icons from “Standard Icons ” Image library,then I can't see the button at all. When used the icons from "This Stack" Image library, then the button shows OK.
But I still don't know why?

Best Regards

Steven

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Custom button can't show on android emulator

Post by Klaus » Wed Mar 10, 2021 4:06 pm

Hi Steven,

to show an image in a BUTTON, you need to set the buttons ICON to the ID of your image.

But the icons in the Standard Icons” Image library do have VERY HIGH IDs and in the runtime/standlaone
these images belonging to these IDs are not found inside of your stack(s), so the image cannot be displayed
inside of your buton.

Best

Klaus

Steven Meng
Posts: 4
Joined: Wed Mar 10, 2021 7:02 am

Re: Custom button can't show on android emulator

Post by Steven Meng » Thu Mar 11, 2021 5:03 am

Hi Klaus,

Thanks for your detailed explanation :D ! I already knew how to use the Standard Icons in the stack. Firstly, go to the menu Development->Image Library, select which I want to used icons from "Standard Images", then click the "Place Image" button to place the Image to This stack, then icons will have a lower ID and can be used in the stack.

Best Regards

Steven

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Custom button can't show on android emulator

Post by richmond62 » Thu Mar 11, 2021 10:08 am

SShot 2021-03-11 at 11.05.00.png
-
I have got myself "in a fluster" many times with what happens to buttons when they end up on different platforms, so,
in 2003 I gave up buttons almost completely . . .

I generally set up buttons the way I like them, and then import them as snapshots (i.e. images) to use
as buttons, or as icons for buttons, or as backGroundPatterns for graphic objects.

Steven Meng
Posts: 4
Joined: Wed Mar 10, 2021 7:02 am

Re: Custom button can't show on android emulator

Post by Steven Meng » Thu Mar 11, 2021 2:57 pm

Hi richmond62

It's a good solution, I will try it later.
Thanks for your sharing!

Best Regards

Steven

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Custom button can't show on android emulator

Post by jacque » Thu Mar 11, 2021 7:00 pm

I avoid using images as buttons whenever possible, because if you need to change anything (a label, an icon, colors, whatever) then you have to make new images all over again. Buttons with icons are far more flexible and convenient. Also, if you plan to resize the stack for different size screens, images may not scale correctly and can pixellate.

I suspect Richmond uses images in order to display labels in a font the user may not have installed. That's one of the few times I might do that, though including the font in the stack is a better solution.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Custom button can't show on android emulator

Post by richmond62 » Thu Mar 11, 2021 8:12 pm

I suspect Richmond uses images in order to display labels in a font the user may not have installed.
-
SShot 2021-03-11 at 21.10.26.png
SShot 2021-03-11 at 21.10.26.png (6.81 KiB) Viewed 3302 times
-
That is part of the reason.

But the other part is that I really like 100% congruency of Look-and-Feel cross-platform.

Post Reply

Return to “Android Deployment”