Native IO doesn't keep scroll when images stretched width to width

Hi,

So I use long screenshots to study my IO cards on my iPad (AnkiMobile) and by default the images won’t stretch width to width due to which I have to zoom in on every card.

I found a CSS code on this forum to fix that -

#image-occlusion-container {
max-height:100%;  
max-width:100%;
}

But when I flip the card after applying this code , Anki won’t keep the scroll to that position and instead automatically scrolls up to the top (it stays at the same position when not using the above code i.e. works fine).

Here the example :

After clicking the answer button it automatically scrolls up -

Now is there any workaround to this issue?

I’m afraid I/O currently expects the image to be fit inside the screen when it’s shown. It may be possible to support such changes in the future - I’ll keep an eye on demand for this.

@dae Is there any tweak I can do in the card template code which would ‘keep the scroll position’?

Probably not I’m afraid - it was not designed with such CSS styling in mind.

@dae Just a follow up, the code I provided above also works when used both on front and back of the card code. Would this be able to help or is it the same case like you said earlier?

@dae I guess this user also had the same request and you said it’s fixed so did the new update change something?

I believe the linked report is a bit different - it was about retaining the zoomed in position after pinching, when the ‘answer keeps zoom’ option is enabled in the review preferences. I presume you’ve already tested that option with your CSS changes?

@dae Yes I’ve tested this after the CSS changes and the ’ answer keeps zoom’ does keep the zoom level but it doesn’t retain the zoomed position. Although it does retain the zoom position without the CSS change which is exactly I was looking to fix.

Since the zoom position is already retained without the CSS code then is it possible that there is another way (through changing code in card template) that I can add some different code to keep having the ‘retain zoom position’ while also fitting the images width to width?

If there were an easy solution, I would have already provided it :slight_smile: I’m afraid what you want probably can’t be accomplished without changes to AnkiMobile.

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