react-native-scrolltab

0.1.1 • Public • Published

ScrollTab

效果展示

安装方法

npm i --save react-native-scrolltab

js 调用

import ScrollTab from 'react-native-scrolltab';
 
export default class exsample extends Component {
  // 构造
    constructor(props) {
      super(props);
      // 初始状态
      this.state = {
          activeTab: 0
      };
    }
  render() {
    return (
      <View style={{flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF'}}}>
        <ScrollTab tabs={['item1','item2','item3','item-4-item','item5','item6','item7','item8']}
             activeTab={this.state.activeTab}
             goToPage={(index)=>{this.setState({activeTab: index})}}
        />
      </View>
    );
  }
}
 

Package Sidebar

Install

npm i react-native-scrolltab

Weekly Downloads

1

Version

0.1.1

License

ISC

Last publish

Collaborators

  • ferryvip