1.0.4 • Published 2 years ago

@mshengyang/react-native-scrollable-tab v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@mshengyang/react-native-scrollable-tab

Installation

npm install @mshengyang/react-native-scrollable-tab
//or
yarn add @mshengyang/react-native-scrollable-tab

Usage

import ScrollableTabView from '@mshengyang/react-native-scrollable-tab';

// ...

<ScrollableTabView
        initialPage={1}
        tabBarUnderlineStyle={{
          backgroundColor: '#0BC2D2',
        }}
        onChangeTab={(page) => {
          console.log('17=>', page);
        }}
        tabBarActiveTextColor={'#0BC2D2'}
        style={{
          borderWidth: 0,
          marginTop: 8,
        }}
        tabs={['tab1', 'tab2', 'tab3']}
        contentProps={{ style: { borderWidth: 0 } }}
      >
        <View style={{ flex: 1 }}>
          <Text>1</Text>
        </View>
        <View style={{ flex: 1 }}>
          <Text>2</Text>
        </View>
        <View style={{ flex: 1 }}>
          <Text>3</Text>
        </View>
      </ScrollableTabView>

API

propsdesctype
initialPage初始页面number
page页面number
onChangeTabtab变化的回调(param: { i: number; from: number }): void;
onScroll滚动的回调onChangeTab?(param: { i: number; from: number }): void;
renderTabBar自定义Tabbarfalse | ((props: DefaultTabBarProps) => any);
tabBarUnderlineStyleBar下划线样式ViewStyle
tabBarBackgroundColorBar 背景色string
tabBarActiveTextColorBar激活时的text颜色string
tabBarInactiveTextColor未激活的text颜色string
tabBarTextStyletext styleTextStyle
stylebar container 样式ViewStyle
contentProps内容区PropsScrollViewProps
scrollWithoutAnimation是否启用滚动动画boolean
locked禁止滚动boolean
preRenderingSiblingsNumber预渲染页面数量number
tabstab列表string[]

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago