I’m attempting to display an image in an alert similarly to the post here.
[Clickable Images]
I’d like the image to fill the screen width, and I’m hoping that there is an easy way to do that within an alert. I tried looking through the Image Properties API [Anvil Docs | anvil] but can’t seem to find what arguments can be passed to display_mode
and what they do. Is there an argument to make the image fill its container’s width, or a better way to do this?
Image(source=photo.jpg, display_mode=????)
alert
can only be large=True
or large=False
.
So, as long ad you are inside an alert
, those are your options… unless you want to pay with css and change how alert
looks.
There is exactly a property like this and it’s called fill_width
Image(source=photo.jpg, display_mode='fill_width')
Thanks @stefano.menci, but I was looking to alter the image within the alert
, not the alert itself. Thank you @divyeshlakhotia, that is the page that I could not find! Setting the display_mode='fill_width'
worked perfectly!
1 Like