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.

Square image in Horizontal Listview

See original GitHub issue

I am attempting to create a XML code for a SimpleDraweeView to display a square image in different RecyclerViews.

<com.facebook.drawee.view.SimpleDraweeView
   android:id="@+id/card_item_image"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   fresco:actualImageScaleType="centerCrop"
   fresco:viewAspectRatio="1"/>

I can achieve square images in any type of vertical list. My issue is that if I attempt to use this layout for any horizontal lists, the SimpleDraweeView is not present.

(The image below shows 3 lists. The first is a horizontal list, while the two lists below are vertical.) screenshot

I understand that Fresco has issues when it comes to not setting width and/or height. If I set the Width to wrap, nothing is show, so viewAspectRatio only works when it has a width.

Is there a workaround for this and can this be altered to accommodate square image based on available height instead of width?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
k2evilcommented, Jul 2, 2018

Guys it’s so annoying. Please consider to fix this bug

0reactions
phoesoncommented, Sep 25, 2018

Guys it’s so annoying. Please consider to fix this bug

UP

Read more comments on GitHub >

github_iconTop Results From Across the Web

Emulating horizontal list of images as seen in google play app
1) 3 perfectly squared images are fully seen and another one is partially shown. The second one (the greenish one) is right in...
Read more >
Flutter Horizontal ListView With Image-Build A Material App
My Facebook group.join to this group if you want free coupon of my udemy course: https://www.facebook.com/groups/2057947887830643/Please ...
Read more >
Item containers and templates - Windows apps - Microsoft Learn
ListView and GridView controls manage how their items are arranged (horizontal, vertical, wrapping, etc…) and how a user interacts with the ...
Read more >
29. Building Grid Layout Using LazyVGrid and LazyHGrid
In this chapter, I will walk you through how to create both horizontal and vertical views. Both LazyVGrid and LazyHGrid are designed to...
Read more >
How To Use Images In Flutter — To The Point | by Pinkesh Darji
There is hardly any app that doesn't use the images at all ... empty space (Green colored part of the container) horizontally in...
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