Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Aspect ratio of an image view?
-
Hi,
in the UI editor of a Python script action I created a ScrollView and inside that ScrollView I embedded an ImageView.
At design time I have to set the dimensions of that image view. Currently it's the default square (200x200).Via the Image URL property I loaded a non-square image that's displayed distorted now because the view want to make both, the width & the height to fit.
Is there a way to tell the IamgeView not to squeeze my non-square image into the square view?
I want to add several more ImageViews later and they all should be square but the actual images won't be square most of the time.Thanks,
Stefan. -
Oh! I found something!
Looks like I have to set the propertycontent_mode
of the ImageView.
Like this:view.subviews[0].subviews[0].content_mode = ui.CONTENT_SCALE_ASPECT_FIT
I can't find this property in the UI editor. So I have to set it at run time?