Segmented Control on Android for React Native like SegmentedControlIOS
npm install react-native-segmented-control-androidSegmented Control on Android for React Native like SegmentedControlIOS
$ npm install react-native-segmented-control-android --save
$ react-native link react-native-segmented-control-android
1. Open up android/app/src/main/java/[...]/MainActivity.java
- Add import com.reactlibrary.RNSegmentedControlAndroidPackage; to the imports at the top of the file
- Add new RNSegmentedControlAndroidPackage() to the list returned by the getPackages() method
2. Append the following lines to android/settings.gradle:
```
include ':react-native-segmented-control-android'
project(':react-native-segmented-control-android').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-segmented-control-android/android')
android/app/build.gradle
3. Insert the following lines inside the dependencies block in :`
`
compile project(':react-native-segmented-control-android')
javascript
import RNSegmentedControlAndroid from 'react-native-segmented-control-android';// TODO: What to do with the module?
RNSegmentedControlAndroid;
``