How to hide/show a group of images all at once using “for each item”?

Hello,

I created a list of images and want to show one at a time depending on the index label I want: example if I type 1 I want the cat image to show, 2= dog and so one.
Since there is a couple dozen images I thought that using “For each item in list” component" like this would be best:

image

What I hoped from this code to do is hide all images and only show the one image that match it’s index.

this doesn’t seem to be working coz images are not labels and the program error say that it was expecting a label not an image.

Any workaround or maybe is there a better idea?

Thanks :slight_smile:

Where you creating the list…
I mean you are using online database Or local variable…
@Houssam_Zakaria

Hi, I’m using a local variable

what about using only one label to display the text and one image component to display the chosen image? i.e. do not use the advanced components in your case…
Taifun

1 Like

Thanks good catch, I just tried that but for some reason it ain’t working :frowning:

Okay it’s solved , I refered directly to the assets instead of the images in the designer: image

Thanks

Try this

Instead of TextBox, you may use a ListPicker to avoid typing errors by the user.

2 Likes

A post was split to a new topic: Kodular companion every time i opend the he want from me a cmpanion code

Thanks a lot my friend, where do you find the “Set Image of component to” component?

In the Blocks tab, goto the blocks list (to the left), in the bottom of your components list used, click Any component. Then select.

1 Like

َََAmazing man just amazing, been seeing those kind of blocks but had no idea where to get them. Now I know thanks to you :smiley:

1 Like

@Houssam_Zakaria When I also discovered them, a large world opened to me for ideas!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.