欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

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

正文

一個帶有分頁功能的介紹頁面旋轉(zhuǎn)木馬(onboarding)動畫。

如何使用它

1.安裝并導入 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)用程序介紹的詳細內(nèi)容,更多關(guān)于React Native 旋轉(zhuǎn)木馬的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • React特征學習Form數(shù)據(jù)管理示例詳解

    React特征學習Form數(shù)據(jù)管理示例詳解

    這篇文章主要為大家介紹了React特征學習Form數(shù)據(jù)管理示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-09-09
  • React觸發(fā)render的實現(xiàn)方法

    React觸發(fā)render的實現(xiàn)方法

    這篇文章主要介紹了React觸發(fā)render的實現(xiàn)方法,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2023-10-10
  • react中使用heatmap.js實現(xiàn)熱力圖的繪制

    react中使用heatmap.js實現(xiàn)熱力圖的繪制

    heatmap.js?是一個用于生成熱力圖的?JavaScript?庫,React?是一個流行的?JavaScript?庫,用于構(gòu)建用戶界面,本小編給大家介紹了在React?應(yīng)用程序中使用heatmap.js實現(xiàn)熱力圖的繪制的示例,文中通過代碼示例介紹的非常詳細,需要的朋友可以參考下
    2023-12-12
  • React?中的列表渲染要加?key的原因分析

    React?中的列表渲染要加?key的原因分析

    這篇文章主要介紹了React?中的列表渲染為什么要加?key,在?React?中我們經(jīng)常需要渲染列表,比如展示好友列表,文中給大家介紹了列表渲染不提供?key?會如何,通過實例代碼給大家介紹的非常詳細,需要的朋友一起看看吧
    2022-07-07
  • React報錯Function?components?cannot?have?string?refs

    React報錯Function?components?cannot?have?string?refs

    這篇文章主要為大家介紹了React報錯Function?components?cannot?have?string?refs解決方案詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-12-12
  • React的生命周期函數(shù)初始掛載更新移除詳解

    React的生命周期函數(shù)初始掛載更新移除詳解

    這篇文章主要為大家介紹了React的生命周期函數(shù)初始掛載更新移除詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-08-08
  • react組件中過渡動畫的問題解決

    react組件中過渡動畫的問題解決

    這篇文章主要為大家介紹了react組件中過渡動畫的問題解決,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-09-09
  • React中useTransition鉤子函數(shù)的使用詳解

    React中useTransition鉤子函數(shù)的使用詳解

    React?18的推出標志著React并發(fā)特性的正式到來,其中useTransition鉤子函數(shù)是一個重要的新增功能,下面我們就來學習一下useTransition鉤子函數(shù)的具體使用吧
    2024-02-02
  • React Native 腳手架的基本使用詳解

    React Native 腳手架的基本使用詳解

    這篇文章主要介紹了React Native 腳手架的基本使用詳解,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2021-04-04
  • react?fiber執(zhí)行原理示例解析

    react?fiber執(zhí)行原理示例解析

    這篇文章主要為大家介紹了react?fiber執(zhí)行原理示例解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-11-11

最新評論