dynamic+static swiper
See original GitHub issueI have a weird issue trying to use dynamic&static content in Swiper. Im not able to use both approaches to create the result I need.
My code is:
<Swiper horizontal={false}>
<View> ...View 1 (static header)...</View>
{this.items.map((item, key) => {
return (
<View key={key} style={styles.slide1}>
<Text>bla bla</Text>
</View>
)
});
}
<View> ... View 3 (static footer) ...</View>
</Swiper>
This will produce something like:
View 1 (static header) / View 2 --> Contains 4 childviews where each view take 1/4 of the screen / View 3 (static footer)
On the other hand, if I delete header and footer and I leave the map function alone I will see the 4 views I’m expecting… any idea?
Thanks! Juan
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:26
Top Results From Across the Web
How to make static slider (Swiper JS) dynamic in Oxygen Builder
Short tutorial on how to transform static slider using Swiper JS library to dynamical one.
Read more >Swiper Demos
Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior.
Read more >Mixing static and dynamic items in react-native-swiper
But if I have one static item and multiple dynamic items the swiper only shows the static + one of the dynamic. So...
Read more >Help with dynamically embedding items in Swiper slider code
Continued using Swiper slider, but I input the static content manually from CMS Collection via custom code since it's less than 10 items ......
Read more >Creative type insights for Amazon DSP static and dynamic ads
Are you trying to decide between static image ads, Dynamic or Responsive eCommerce Ads? Not sure if you should use a tailored headline...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same issue. I needed to create an array of views so I guess you could do sth like this:
Hi Juan,
Your options are to give each slide their own header/footer (swiper may need custom styles for this to work, or place the header/footer with absolute positioning):
or, wrap the swiper in the header / footer: