I know that one can add images like this...
or kv string like this...
But how can I do this loop in the kv code syntax...instead of images one below the other...
I tried a function but not sure how to call this function in the kv file...
CrossPosted HERE
Code:
def build(self):
carrusel = Carousel(direction='bottom')
for n in range(1, 15):
src = f"roxxane/{n}.jpg"
image = AsyncImage(source=src, allow_stretch=True)
carrusel.add_widget(image)
or kv string like this...
Code:
Carousel:
direction: 'right'
Image:
source: 'Images\Carousel\Jose-Cuervo.png'
Image:
source: 'Images\Carousel\Absolut.png'
But how can I do this loop in the kv code syntax...instead of images one below the other...
I tried a function but not sure how to call this function in the kv file...
Code:
class Tester(App):
def build(self):
scr = Builder.load_string(Code)
return scr
def add_Img(self, *args):
box = self.root.ids.box
for i in range(2):
str = 'Images\Carousel\{i}.png'
box.add_widget(str(i))
CrossPosted HERE