How can I add a label inside a canvas?

your solution is good but i mean as UI component a label for example not letterly a text string

Same result:

Just because of this?

no for sure these are minor reasons , in short so far a label is fair enough for me but sure if you can let it add all the UI components like a [ button , textbox , label ... ] these i guess are the most important and vital UI components.

Why not just set an arrangement's background to the image, and then put all of the components inside?

image

labelOverCanvas_2.aia (11.4 KB)

Generally, it is not a good idea to put buttons on a canvas. Why would you have animation happening at the background of the components?

a sample that is easily can be accomplished with canvas + labels + font , but in any other way it will be super hard.

i know i can use sprites instead of labels but the app size will be much big than simple font which doesn't take 400 kb at maximum , instead of more than 20 images which at least it will take 900 kb or 1000 kb.

image

You can also try

1 Like

same problem it crash on the very first run of the app and closes fast

I will check it and see , i tried to import the extension to app inventor and it worked that's promising so far :smiley:

thank you.

A very simple example

1 Like

unfortunately that extension is limited in positions like there are only 9 options so it's not useful for my case.

You can set gravity by giving an integer

image

1 Like

but in his documentation it isn't clear like this so it's more than 9 positions i will try it probably this is the solution for my dilemma , i hope it doesn't crash on start up either :smiley:

i built over 6 apks and didn't work for me can you share your aia file please , for the verticalarrangement i set it fill parent for both height + width but with no work the label is stuck on top left corner even with gravity 300 , 100 and others.

relative_view.aia (6.7 KB)

1 Like

thanks but it's super weird on my emulator

it showed up like this even with gravity 22 , 50 , i'll try it on real device and see.

update : it worked on emulator but probably cache thing of old version of the apk stucked.

@dora_paz

This is what it showed when I tested the AIA. Not sure if this is want @Don_Ammar wanted, though.

1 Like

yes it works fine on real device but on external emulator it doesn't that's really weird

same result as yours on real device i think that is the optimal solution.

update : it worked on emulator but probably cache thing of old version of the apk stucked.