react-native-bottom-sheet -


MIT
Android
Java

软件简介

react-native-bottom-sheet

Android Bottom Sheet 的 React Native 实现。

Demo

如何安装(How to install)

首先安装 npm 包(Install package from npm first)

npm install react-native-bottom-sheet --save

link(current may not support)

rnpm link

Edit android/settings.gradle to look like this (without the +):

rootProject.name = 'MyApp'

include ':app'

+ include ':react-native-bottom-sheet'
+ project(':react-native-bottom-sheet').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bottom-sheet/android')

Edit android/app/build.gradle (note: app folder) to look like this:

apply plugin: 'com.android.application'

android {
...
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+"  // From node_modules
+ compile project(':react-native-bottom-sheet')
}

Edit your MainApplication.java (deep in android/app/src/main/java/...) to
look like this (note two places to edit):

package com.myapp;

+ import com.gnet.bottomsheet.RNBottomSheetPackage;

....

@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
    new MainReactPackage()
+   , new RNBottomSheetPackage()
    );
}

}

注意:

  • rnpm 要求 node 版本在 4.1 及以上

  • Android SDK Build-tools 23.0.1 及以上版本