android 视觉差效果,视觉差效果欢迎页 – react-native-app-intro

react-native-app-intro

react-native-app-intro是一个react native组件,实现了一个视觉差效果欢迎页,基于react-native-swiper,类似与谷歌应用程序比如Sheet,Drive,Docs等。

支持iOS、Android

vuaaMv.gif

7Rfaqe.gif

安装

基础使用

你可以使用pageArray快速生成具有视差效果的app介绍。随着基础的使用方法,Android状态栏将会更新为匹配相关的背景颜色。

JRzeEf.gif

2YBB7v.gif

import React, { Component } from 'react';

import { AppRegistry, Alert } from 'react-native';

import AppIntro from 'react-native-app-intro';

class Example extends Component {

onSkipBtnHandle = (index) => {

Alert.alert('Skip');

console.log(index);

}

doneBtnHandle = () => {

Alert.alert('Done');

}

nextBtnHandle = (index) => {

Alert.alert('Next');

console.log(index);

}

onSlideChangeHandle = (index, total) => {

console.log(index, total);

}

render() {

const pageArray = [{

title: 'Page 1',

description: 'Description 1',

img: 'https://goo.gl/Bnc3XP',

imgStyle: {

height: 80 * 2.5,

width: 109 * 2.5,

},

backgroundColor: '#fa931d',

fontColor: '#fff',

level: 10,

}, {

title: 'Page 2',

description: 'Description 2',

img: require('../assets/some_image.png'),

imgStyle: {

height: 93 * 2.5,

width: 103 * 2.5,

},

backgroundColor: '#a4b602',

fontColor: '#fff',

level: 10,

}];

return (

onNextBtnClick={this.nextBtnHandle}

onDoneBtnClick={this.doneBtnHandle}

onSkipBtnClick={this.onSkipBtnHandle}

onSlideChange={this.onSlideChangeHandle}

pageArray={pageArray}

/>

);

}

}

AppRegistry.registerComponent('Example', () => Example);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值