Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

stretch not working #10

Open
gabitoesmiapodo opened this issue Nov 5, 2017 · 2 comments
Open

stretch not working #10

gabitoesmiapodo opened this issue Nov 5, 2017 · 2 comments

Comments

@gabitoesmiapodo
Copy link

The stretch attribute seems not to be working.

Whatever I put in it (aspectFill, aspectFit, etc.), I inspect it on the Chrome dev tools debugger, and it's always 'fill'.

Seems to be the same on Android and iOS.

As a result, if I have a picture of, say, 120x120px with a square in it... it will look as a rectangle.

screen shot 2017-11-05 at 02 51 46

Currently on TNS 3.2.1, and nativescript-image-cache 1.0.8

@yezarela
Copy link
Owner

yezarela commented Nov 6, 2017

Thanks @gabitoesmiapodo , are you using nativescript+angular or just nativescript?

@gabitoesmiapodo
Copy link
Author

gabitoesmiapodo commented Nov 6, 2017

I'm using Nativescript + Angular, and I forgot to mention the problem arises when I use the element on a ListView with several items.

When I use it by itself (say, inside a GridLayout, StackLayout, etc.), stretch seems to work fine so far, or I didn't notice anything strange at least.

Here's a sample of the code involved.


<ListView
    (itemTap)="listViewItemTap($event)"
    (loadMoreItems)="loadMoreItems()"
    [items]="theItems"
    class="list-group full-height"
    separatorColor="transparent"
>
    <ng-template let-item="item">
            <GridLayout
                class="list-item"
                columns="auto, *, auto"
                rows="*"
            >
                <StackLayout
                    col="0"
                    row="0"
                >
                    <NSImage
                        [src]="getItemImage(item)"
                        class="thumb thumb-rounded thumb-xxl"
                        placeholder="res://product_placeholder"
                        placeholderStretch="aspectFill"
                        radius="120"
                        stretch="aspectFill"
                    ></NSImage>
                </StackLayout>
                <StackLayout
                    class="text-container"
                    col="1"
                    orientation="vertical"
                    row="0"
                    verticalAlignment="center"
                >
                    <Label [text]="item.title" class="list-item-title"></Label>
                </StackLayout>
                <Label
                    class="list-item-chevron full-height"
                    col="3"
                    row="0"
                ></Label>
            </GridLayout>
    </ng-template>
</ListView>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants