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.

ListView image conflict when width and height is set

See original GitHub issue

I’m using NativeScript with Angular. I have a list view that is rendering some json data. When I set the width and height property to my Image tag, it make some problem. Then when I scroll down, first it loads previous images, and then changes to the real images. (Without width and height, it works perfect, and when I scroll, first it’s blank, the the real images get loaded.)

Here is my code:

<ListView [items]="europianCountries" class="list-group">
    <ng-template let-country="item" let-i="index" let-odd="odd" let-even="even">
        <GridLayout class="list-group-item">
            <ListView.itemTemplate>
                    <Image width="100" height="100" stretch="aspectFill" id="item" (tap)="onItemTap($event)" (pinch)="onPinch($event)" [src]="'http://luxa.club/'+country.post_picture_time"></Image>
            </ListView.itemTemplate>
        </GridLayout>
    </ng-template>
</ListView>

Any idea?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vahidvdncommented, Mar 14, 2018

@tsonevn Also for my own issue, I changed my view and now it works fine:

<GridLayout rows="*">
    <ListView separatorColor="#d38008" [items]="europianCountries">
        <ng-template let-country="item" let-i="index" let-third="third">
            <StackLayout style="padding: 50px">
                <Image width="350" stretch="aspectFill" id="item" (tap)="onItemTap($event)" (pinch)="onPinch($event)" [src]="'http://luxa.club/'+country.post_picture_time"></Image>
                <Label [text]='country.post_description'></Label>
            </StackLayout>
        </ng-template>
    </ListView>
</GridLayout>
0reactions
lock[bot]commented, Aug 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin resize Listview item-height based on viewcell width
Actually what I want is that RowDefinition Height="ColumnDefinition Width="15*"", so the both resize linear based on the parameter set as width.
Read more >
SingleChildScrollView class - widgets - Flutter - Dart API docs
A box in which a single widget can be scrolled. This widget is useful when you have a single box that will normally...
Read more >
How to display images with different sizes with keeping their ...
TileSize = new Size(width, height); sets a given size for all images in listview, how can i do this separately for each of...
Read more >
Class CQ.Ext.list.ListView - Adobe Developer
Ext.Panel({ id:'images-view', width:425, height:250, collapsible:true, ... The maximum value in pixels which this BoxComponent will set its height to.
Read more >
Titanium.UI.ListView
ListView.templates property, then use the style name to set the Titanium. ... properties: { // Sets the image view properties width: '50dp', height:...
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