question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CachedImage Auto Height

See original GitHub issue

This may be a dumb question, but is there not a way to have CachedImage fill the width and have the height be whatever it needs to be in respect of the width? This is how the Image tag works in Xamarin.Forms, but it doesn’t work properly for CachedImage.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
daniel-luberdacommented, Nov 13, 2017

Just as @CarLoOSX said - it’s a thing we need to change in an upcoming major release. It’s mentioned in every FFImageLoading release notes.

FFImageLoading has a regression since 2.2.4 which caused CachedImage to always fill entire space available (different behaviour than Image. It’s now fixed, but as it was included in many versions it may be a breaking change for some. That’s why I didn’t enable that fix by default. You can do it manually with:

CachedImage.FixedOnMeasureBehavior = true; Read more here: #545

Also for Xamarin.Forms >= 2.4 please set: CachedImage.FixedAndroidMotionEventHandler = true if experiencing any gesture recognizers problems on Android.

I’ll include it as a default in next major version.

Xamarin.Forms (Android) now uses fast renderers by default if possible (correct XF version). You can enable / disable fast renderers by CachedImageRenderer.Init(enableFastRenderer: [true/false] override.

2reactions
CarLoOSXcommented, Nov 13, 2017

Okay I’m not having this problem in iOS, but in Android the images doens’t appears, I thought it was this problem but I have corrected in MainActivity using this: CachedImageRenderer.Init(enableFastRenderer: true); CachedImage.FixedAndroidMotionEventHandler = true;

You can see the explanation in the release notes of the last version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin forms listview - show images full widh, auto height
When an image is taller than it is wide, show the image flush to the left and right with no margins, have the...
Read more >
cached_network_image | Flutter Package
Flutter library to load and cache network images. Can also be used with placeholder and error widgets.
Read more >
Images not displayed correctly in ListView - Height
Here is my background code. I use data-binding to achieve it. I can cacluate the ratio, then based the current page's height. You...
Read more >
Work with cached images
The cached_network_image package allows you to use any widget as a placeholder. In this example, display a spinner while the image loads. content_copy....
Read more >
Xamarin Forms Image with 100% of parent container width ...
Coding example for the question Xamarin Forms Image with 100% of parent container width and auto Height to maintain aspect ratio.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found