A
A
Ander8132019-04-06 13:27:11
Python
Ander813, 2019-04-06 13:27:11

How to make images not resize in kivy?

from kivy.uix.scrollview import ScrollView
from kivy.core.window import Window
from kivy.app import runTouchApp
from kivy.uix.image import AsyncImage
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label

from main import getPhotos


layout = GridLayout(cols=1, spacing=10, size_hint= (1,None))
layout.bind(minimum_height=layout.setter('height'), minimum_width = layout.setter('width'))
photos = getPhotos()

for i in photos:
    image = AsyncImage(source = i, size_hint = (1, None))
    layout.add_widget(image)

root = ScrollView(size_hint=(1, None), size=(Window.width, Window.height))
root.add_widget(layout)

runTouchApp(root)

getPhotos returns a list of photo links.
it turns out that's it, 5ca87e08e90b6988468244.png
but I would like that the pictures were full-sized or decreased when the screen width was not enough.
5ca87ecae3a8a192854791.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question