“Reaktnatywny przesuwany obraz” Kod odpowiedzi

Reaktnatywny przesuwany obraz

import { SliderBox } from "react-native-image-slider-box";
Frantic Ferret

Reaktnatywny przesuwany obraz

<SliderBox images={this.state.images} />
Frantic Ferret

Reaktnatywny przesuwany obraz

export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      images: [
        "https://source.unsplash.com/1024x768/?nature",
        "https://source.unsplash.com/1024x768/?water",
        "https://source.unsplash.com/1024x768/?girl",
        "https://source.unsplash.com/1024x768/?tree", // Network image
        require('./assets/images/girl.jpg'),          // Local image
      ]
    };
  }
  // other component code ...
}
Frantic Ferret

Reaktnatywny przesuwany obraz

//res: https://www.npmjs.com/package/react-native-image-slider-box
//1- add below import in your code :
import { SliderBox } from "react-native-image-slider-box";

//2- Define your image array source, for below examples i create array in state.
export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      images: [
        "https://source.unsplash.com/1024x768/?nature",
        "https://source.unsplash.com/1024x768/?water",
        "https://source.unsplash.com/1024x768/?girl",
        "https://source.unsplash.com/1024x768/?tree", // Network image
        require('./assets/images/girl.jpg'),          // Local image
      ]
    };
  }
  // other component code ...
}

//3- Use SliderBox such as these below examples :
//Example 1 : SliderBox without and handler or customization
<SliderBox images={this.state.images} />
Frantic Ferret

Odpowiedzi podobne do “Reaktnatywny przesuwany obraz”

Pytania podobne do “Reaktnatywny przesuwany obraz”

Więcej pokrewnych odpowiedzi na “Reaktnatywny przesuwany obraz” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu