Replies: 2 comments 4 replies
-
you can use this plugin and pass it custom transformers based on whether it's iOS or Android https://github.com/nativescript-community/ui-pager for android uses viewpager2 and for iOS uicollectionview. I have done what you say works on android. in iOS I did not get to implement it. here is how to pass a transformer for android https://github.com/vallemar/nativescript-stack-slide-pager-animation/blob/master/src/components/Home.vue#L35 |
Beta Was this translation helpful? Give feedback.
-
I made something similar for a client project. Some of the code should be relevant for you: https://stackblitz.com/edit/nativescript-stackblitz-templates-xg7gne |
Beta Was this translation helpful? Give feedback.
-
Hi guys!
I'm a bit stuck on displaying some data with images. The problem i'm having follows:
I can't make any CR for the backend so the data i'm working with is fix. I'm getting an object of array with the following structure:
[
{
id: number,
name: string,
desc: sring,
image string, //as a valid url
},
....
]
I need to display the content of the array as seen on the attached beautifulpaint art done by me :) Basically the intended way this works:
This is a component where the user can choose one from multiple gifts.
We have 3 "slots" a previous, an active and a next slot. Both the prev and next slots are smaller than the active slot, and they only display half of the image (or the full image but half of it is pushed out of screen). Also the inactive slots have their image graysacled or displayed with 0.5 opacity. (Should be grayscale but in the app i have gray background so the opacity has the same effect).
The active image has 100% height, has no image transformation and it has all the data written under it also a button. If the button is tapped on the .ts side i need to know all the data from the active element.
Also on left or right swipe the elements should rotate in the correct direction (like scrolling a ScrollView).
I can make a layout that looks like this, also on swipe i can switch the active image and correctly display the prev and next image via keeping track on the active index of the array.
But i cant animate it and also can not crop the inactive images to half.
So my questions:
Is there any method to display only half of the image?
Can i somehow use ScrollView to achive this scrolling functionality?Or is there a better way?
Beta Was this translation helpful? Give feedback.
All reactions