最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

適用于React?Native?旋轉(zhuǎn)木馬應(yīng)用程序介紹

 更新時(shí)間:2022年10月25日 16:32:05   作者:Jovie  
這篇文章主要介紹了適用于React?Native?旋轉(zhuǎn)木馬應(yīng)用程序介紹,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪

正文

一個(gè)帶有分頁(yè)功能的介紹頁(yè)面旋轉(zhuǎn)木馬(onboarding)動(dòng)畫(huà)。

如何使用它

1.安裝并導(dǎo)入 react-native-intro-carousel

# Yarn
$ yarn add react-native-intro-carousel
# NPM
$ npm i react-native-intro-carousel
import * as React from 'react';
import { Image, StyleSheet, View } from 'react-native';
import Carousel from 'react-native-intro-carousel';

2.示例應(yīng)用程序

export default function App() {
  return (
    <View style={styles.container}>
      <Carousel
        data={[
          {
            key: '1',
            title: 'Cool package',
            description: 'This is a cool package',
            backgroundColor: '#e879f2',
            image,
            titleStyle: {
              color: 'white',
            },
            descriptionStyle: {
              color: 'white',
            },
          },
          {
            key: '2',
            title: 'Good information here',
            description: 'This is a good information\nOther text here',
            backgroundColor: '#f0ae35',
            image,
            imagePosition: 'center',
            // contentStyle: {
            //   justifyContent: 'space-evenly',
            // },
            titleStyle: {
              color: 'white',
            },
            descriptionStyle: {
              color: 'white',
            },
          },
          {
            key: '3',
            title: 'I am tired',
            description: 'I am tired',
            backgroundColor: '#79adf2',
            image,
            imagePosition: 'bottom',
            titleStyle: {
              color: 'white',
            },
            descriptionStyle: {
              color: 'white',
            },
          },
        ]}
        // renderItem={({ item }) => <Text>{item.title}</Text>}
        paginationConfig={{
          // dotSize: 10,
          // animated: false,
          // disabled: true,
          dotIncreaseSize: 1,
          dotSpacing: 30,
          // color: '#00000050',
          // activeColor: 'black',
          // activeDotStyle: {
          //   width: 30,
          //   left: -7.5,
          // }
        }}
        buttonsConfig={{
          next: {
            renderButton: (index, onChangeSlider) => (
              <View
                onTouchStart={() => onChangeSlider(index + 1)}
                style={styles.iconButton}
              >
                <Image source={arrowIcon} style={styles.arrow} />
              </View>
            ),
          },
          prev: {
            disabled: true,
          },
          done: {
            renderButton: (index, onChangeSlider) => (
              <View
                onTouchStart={() => onChangeSlider(index + 1)}
                style={styles.iconButton}
              >
                <Image source={checkIcon} style={styles.arrow} />
              </View>
            ),
          },
        }}
        // onFinish={() => console.log('finish')}
        // onPressSkip={() => console.log('test')}
        // renderItem={({ item, index }, goToSlide) => (
        //   <View style={styles.content}>
        //     <Image source={item.image} style={styles.image} />
        //     <Text>{item.title}</Text>
        //     <Text>{item.description}</Text>
        //     <View style={styles.buttonsContainer}>
        //       <Pressable
        //         style={styles.button}
        //         onPress={() => goToSlide(index - 1)}
        //       >
        //         <Text>Previous</Text>
        //       </Pressable>
        //       <Pressable
        //         style={[styles.button, { marginLeft: 10 }]}
        //         onPress={() => goToSlide(index + 1)}
        //       >
        //         <Text>Next</Text>
        //       </Pressable>
        //     </View>
        //   </View>
        // )}
      />
    </View>
  );
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#ecf0f1',
  },
  content: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  button: {
    padding: 10,
    backgroundColor: '#47d16c',
    marginTop: 20,
    borderRadius: 5,
  },
  buttonsContainer: {
    flexDirection: 'row',
  },
  image: {
    width: 200,
    height: 200,
  },
  arrow: {
    width: 30,
    height: 30,
  },
  iconButton: {
    padding: 10,
    borderRadius: 50,
    backgroundColor: '#00000050',
  },
});

預(yù)覽

The postApp Introduction Carousel For React Nativeappeared first onReactScript.

以上就是適用于React Native 旋轉(zhuǎn)木馬應(yīng)用程序介紹的詳細(xì)內(nèi)容,更多關(guān)于React Native 旋轉(zhuǎn)木馬的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • React中的for循環(huán)解讀

    React中的for循環(huán)解讀

    這篇文章主要介紹了React中的for循環(huán)解讀,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-01-01
  • 深入了解React中的合成事件

    深入了解React中的合成事件

    React 中的事件,是對(duì)原生事件的封裝,叫做合成事件。這篇文章主要通過(guò)幾個(gè)簡(jiǎn)單的示例為大家詳細(xì)介紹一下React中的合成事件,感興趣的可以了解一下
    2023-02-02
  • React?diff算法超詳細(xì)講解

    React?diff算法超詳細(xì)講解

    渲染真實(shí)DOM的開(kāi)銷很大,有時(shí)候我們修改了某個(gè)數(shù)據(jù),直接渲染到真實(shí)dom上會(huì)引起整個(gè)dom樹(shù)的重繪和重排。我們希望只更新我們修改的那一小塊dom,而不是整個(gè)dom,diff算法就幫我們實(shí)現(xiàn)了這點(diǎn)。diff算法的本質(zhì)就是:找出兩個(gè)對(duì)象之間的差異,目的是盡可能做到節(jié)點(diǎn)復(fù)用
    2022-11-11
  • React事件處理超詳細(xì)介紹

    React事件處理超詳細(xì)介紹

    這篇文章主要介紹了React事件處理,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2022-09-09
  • react 跳轉(zhuǎn)后路由變了頁(yè)面沒(méi)刷新的解決方案

    react 跳轉(zhuǎn)后路由變了頁(yè)面沒(méi)刷新的解決方案

    最近在學(xué)習(xí)React的過(guò)程中遇到了路由跳轉(zhuǎn)后頁(yè)面不刷新的問(wèn)題,本文就詳細(xì)的介紹一下解決方法,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2021-06-06
  • 利用React高階組件實(shí)現(xiàn)一個(gè)面包屑導(dǎo)航的示例

    利用React高階組件實(shí)現(xiàn)一個(gè)面包屑導(dǎo)航的示例

    這篇文章主要介紹了利用React高階組件實(shí)現(xiàn)一個(gè)面包屑導(dǎo)航的示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-08-08
  • 你知道怎么在 HTML 頁(yè)面中使用 React嗎

    你知道怎么在 HTML 頁(yè)面中使用 React嗎

    這篇文章主要為大家詳細(xì)介紹了如何在HTML頁(yè)面中使用 React,使用使用js模塊化的方式開(kāi)發(fā),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-01-01
  • React 高階組件入門(mén)介紹

    React 高階組件入門(mén)介紹

    本篇文章主要介紹了React高階組件入門(mén)介紹,這篇文章中我們?cè)敿?xì)的介紹了什么是高階組件,如何使用高階組件,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-01-01
  • ReactJS中不同類型的狀態(tài)詳解

    ReactJS中不同類型的狀態(tài)詳解

    這篇文章主要為大家介紹了ReactJS中不同類型的狀態(tài)詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-12-12
  • React組件二次包裝的具體實(shí)現(xiàn)

    React組件二次包裝的具體實(shí)現(xiàn)

    本文主要介紹了React組件二次包裝的具體實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-02-02

最新評(píng)論

新绛县| 云林县| 新津县| 望谟县| 怀集县| 济源市| 九江市| 吴桥县| 河南省| 安庆市| 湄潭县| 利川市| 右玉县| 兴文县| 奇台县| 沂南县| 台南县| 化德县| 平舆县| 博罗县| 泸州市| 宁夏| 宁明县| 神农架林区| 平潭县| 洮南市| 义乌市| 沂源县| 南昌市| 清流县| 通榆县| 孙吴县| 二连浩特市| 明水县| 密云县| 邵武市| 平度市| 大安市| 青龙| 门头沟区| 施甸县|