Closed smarza closed 7 years ago
Any one please ?
@smarza it seems that setting verticalAlignment is causing you issue.
You can overcome this with using the actualImageScaleType on FrescoDrawee
actualImageScaleType
String value used by FrescoDrawee image scale type. This property can be set to:
'center' - Performs no scaling.
'centerCrop' - Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
'centerInside' - Scales the child so that it fits entirely inside the parent.
'fitCenter' - Scales the child so that it fits entirely inside the parent.
'fitStart' - Scales the child so that it fits entirely inside the parent.
'fitEnd' - Scales the child so that it fits entirely inside the parent.
'fitXY' - Scales width and height independently, so that the child matches the parent exactly.
'focusCrop' - Scales the child so that both dimensions will be greater than or equal to the corresponding dimension of the parent.
<nativescript-fresco:FrescoDrawee actualImageScaleType="centerInside"/>
e.g.
<Label text="GridLayout with actualImageScaleType"></Label>
<GridLayout rows="100">
<FrescoDrawee row="0" actualImageScaleType="center" #drawee imageUri="~/images/apple.png"></FrescoDrawee>
</GridLayout>
Closing this issue due to no activity. If you find this an interesting thread you can use the dedicated community forums here.
Hello @VladimirAmiorkov @ginev @sis0k0 @rbasniak,
I upgraded my project to NS3.0 and after that, all my seems to be rendered with height="1" (like a squeezed pancake :) ).
It is easy to recreate this issue in a blank project NS3.0 Angular Project.
To do so, create a new NS project:
tns create HelloWorld --template nativescript-template-ng-tutorial
Add the Fresco Plugin:
tns plugin add nativescript-fresco
Add the base code: app.module.ts
Just for records: Here is the untouched package.json.
Add the sample test code with some FrescoDrawee variations app.component.ts
This code renders like this:
The aspectRatio seems to be not working as it should. I suppose it should calculate the height of those images based on the width and aspectRatio value itself.
Does anyone knows if it is an real issue or if I'm doing some wrong ? Maybe it has a breaking change that I don't know since I am upgrading to NS3.0 version.
All my projects code is based on aspectRatio property, so It's really important. I do much appreciate your help.
Thanks in advance Ricardo