Closed tomups closed 3 years ago
@tomtastico did you try it? As per fresco doc this is not the right way to do it. I am waiting on an answer from the fresco repo here https://github.com/facebook/fresco/issues/2565
Yes it works for me like this:
I suspect it's not the most correct way, but if I use Fresco's StyleType
for setScaleType
the app crashes and in logcat I get:
JNI DETECTED ERROR IN APPLICATION: bad arguments passed to void android.widget.ImageView.setScaleType(android.widget.ImageView$ScaleType) (see above for details)
Also not sure what is going on with the image borders with this fix, it's like the image is drawn over them...
@tomtastico thanks i ll merge it for now and wait for a better answer from the fresco team. Not sure about the borders. Have to think about it
@farfromrefug I think I found a better way, please check the new merge request https://github.com/nativescript-community/ui-image/pull/39 , this one uses Fresco, but I could not test it because somehow my test app has broken and I can't seem to run it again (getting TypeError: Cannot read property 'imagepipeline' of undefined
no matter what I try...). If you can give it a test and see if it works the same...
I fixed my test app, it seems this doesn't work 😞 So skip the merge request, I will close it. No idea how to do it with Fresco...
@tomtastico just so you know i rollbacked your PR. Found the right way to fix the original issue. It has been published
Should fix https://github.com/nativescript-community/ui-image/issues/37 for Android.
I can't currently build nor test iOS, so would be good to know if https://github.com/nativescript-community/ui-image/issues/37 even happens in iOS at all or not.A friend helped me test in iOS and this bug is not present there, it's only in Android.I am not sure if this is the best solution, I see that the scale types used in the plug-in come from
com.facebook.drawee.drawable.ScalingUtils.ScaleType
but when using those insetScaleType
, I was getting a "wrong parameter" error from Android, only using the types fromandroid.widget.ImageView.ScaleType
worked.