Create Image carousel with SwipeView
-
hello, i need to create multiple image carousel with SwipeView but it's showing just one image at once. can someone help me how i can get something like this using SwipeView or other way please?
property var img: ['Toyota', 'Audi', 'Citroen', 'Fiat', 'Ford', 'Honda'] Rectangle { width: 560 height: 215 border.width: 1 border.color: 'lightgrey' anchors.centerIn: parent SwipeView { id: caroussel clip: true anchors.fill: parent currentIndex: indicator.currentIndex Repeater { model: 6 Rectangle { border.width: 1 border.color: '#000' Image { source: 'brands/'+ img[index] fillMode: Image.PreserveAspectFit anchors.fill: parent } } } } } PageIndicator { id: indicator count: caroussel.count anchors.bottom: parent.bottom x: (parent.width/2) - (width/2) currentIndex: caroussel.currentIndex transform: Translate { y: -50 } }
thanks
-
hello, i need to create multiple image carousel with SwipeView but it's showing just one image at once. can someone help me how i can get something like this using SwipeView or other way please?
property var img: ['Toyota', 'Audi', 'Citroen', 'Fiat', 'Ford', 'Honda'] Rectangle { width: 560 height: 215 border.width: 1 border.color: 'lightgrey' anchors.centerIn: parent SwipeView { id: caroussel clip: true anchors.fill: parent currentIndex: indicator.currentIndex Repeater { model: 6 Rectangle { border.width: 1 border.color: '#000' Image { source: 'brands/'+ img[index] fillMode: Image.PreserveAspectFit anchors.fill: parent } } } } } PageIndicator { id: indicator count: caroussel.count anchors.bottom: parent.bottom x: (parent.width/2) - (width/2) currentIndex: caroussel.currentIndex transform: Translate { y: -50 } }
thanks