Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

React Native Image Slider

import React from 'react';
import { StatusBar, StyleSheet, View } from 'react-native';
import { SliderBox } from 'react-native-image-slider-box';

const App = () => {
    const [images, setImages] = React.useState([
        "https://source.unsplash.com/1024x768/?nature",
        "https://source.unsplash.com/1024x768/?water",
        "https://source.unsplash.com/1024x768/?tree",
    ]);

    return (
        <View style={styles.container}>
            <SliderBox 
                images={images}
                sliderBoxHeight={400}
                dotColor="#FFEE58"
                inactiveDotColor="#90A4AE"  
                onCurrentImagePressed={index => console.warn(`image ${index} pressed`)}
                paginationBoxVerticalPadding={20}
                autoplay
                circleLoop
            />
            <StatusBar />
        </View>
    );
}

const styles = StyleSheet.create({
    container: {
        backgroundColor: 'white',
        paddingTop: 10,
        flex: 1,
    },
});

export default App;
Comment

react native intro slider

import React from 'react';
import Icon from 'react-native-vector-icons/Ionicons';
import { StyleSheet, View } from 'react-native';
import AppIntroSlider from 'react-native-app-intro-slider';
 
const styles = StyleSheet.create({
  buttonCircle: {
    width: 40,
    height: 40,
    backgroundColor: 'rgba(0, 0, 0, .2)',
    borderRadius: 20,
    justifyContent: 'center',
    alignItems: 'center',
  },
  //[...]
});
 
// slides = [...]
 
export default class App extends React.Component {
  _renderItem = ({ item }) => {
    return (
      <View style={styles.slide}>
        <Text style={styles.title}>{item.title}</Text>
        <Image source={item.image} />
        <Text style={styles.text}>{item.text}</Text>
      </View>
    );
  }
  _renderNextButton = () => {
    return (
      <View style={styles.buttonCircle}>
        <Ion
          name="md-arrow-round-forward"
          color="rgba(255, 255, 255, .9)"
          size={24}
        />
      </View>
    );
  };
  _renderDoneButton = () => {
    return (
      <View style={styles.buttonCircle}>
        <Ion
          name="md-checkmark"
          color="rgba(255, 255, 255, .9)"
          size={24}
        />
      </View>
    );
  };
  render() {
    return (
      <AppIntroSlider
        data={slides}
        renderDoneButton={this._renderDoneButton}
        renderNextButton={this._renderNextButton}
      />
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery or operator 
Javascript :: how to add a new line in template literal javascript 
Javascript :: javascript join 2 variables into string 
Javascript :: javascript get the last array element 
Javascript :: switch statement js 
Javascript :: discord bot not responding to commands 
Javascript :: clone an object javascript 
Javascript :: props history 
Javascript :: react native firebase 
Javascript :: vue prop using variable 
Javascript :: js function definition 
Javascript :: JavaScript Debug usage Example 
Javascript :: javascript meme 
Javascript :: passport js npm 
Javascript :: object destruction in javascript 
Javascript :: pretty print javascript 
Javascript :: replace element javascript 
Javascript :: proptypes for a react component 
Javascript :: convert number into string 
Javascript :: javascript factorial stack 
Javascript :: identifier in js 
Javascript :: convert binary to string javascript 
Javascript :: function find_max(nums) { 2 let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers for (let num of nums) { if (num max_num) { // (Fill in the missing line here) } } return max_num; 
Javascript :: how to remove document.getElementById("myDropdown").classList.toggle("show"); 
Javascript :: knex muliple like query 
Javascript :: how to push into an array javascript 
Javascript :: Creating an unnamed function 
Javascript :: javascript terminal base64 encoder 
Javascript :: ggufhca spingnift cpwjirbgi bshhv 3 bvvvslit nevkdhaer nhdydg kllojb n 
Javascript :: external javascript files can be cached 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =