Giter Site home page Giter Site logo

Comments (1)

Amacelia avatar Amacelia commented on June 22, 2024 1

I'm sure you've found an alternative, which I'm curious to hear so post it here if you can, but here's how I got it working.

  1. In the node_modules folder, make a folder called 'react-native-horizontal-scroll-picker'
  2. download all the code in this repository and paste it in that folder
  3. in the file you want to use it in, import the way it's detailed:
import {HorizontalScrollPicker} from 'react-native-horizontal-scroll-picker';
import _ from 'lodash';
  1. just use it and edit the styles as you want
...
<HorizontalScrollPicker
          items={emoNumItems}
          textStyle={styles.emoSelect}
          selectedTextStyle={styles.emoSelected}
          containerStyle={styles.scrollPickerContainer}
          itemStyle={styles.item}
          selectorStyle={styles.selectedItem}
          onSelect={(selectI) => this.setState({selectedItem: selectI})}
          initialIdx={0}
        />
...
const styles = StyleSheet.create({
item: {
    textAlign: 'center',
    textAlignVertical: 'center',
    color: '#000',
    fontSize: 18,
  },
  selectedItem: {
    flex: 1,
    position: 'absolute',
    top: 0,
    backgroundColor: 'transparent',
    borderWidth: 0, //indicator line
    borderColor: '#000',
    borderRadius: 12,
  },
  emoSelect: {
    fontFamily: 'AGaramondPro-Regular',
  },
  emoSelected: {
    fontFamily: 'AGaramondPro-Regular',
    fontWeight: 'bold',
  },
});

I changed up the default values a bit for myself so you can just interpret my changes from the original given code.

from react-native-horizontal-scroll-picker.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.