GithubHelp home page GithubHelp logo

imverygood / react-native-scrollable-topbar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mengft/react-native-scrollable-topbar

0.0 1.0 0.0 11 KB

基于React Native封装的资讯频道TopBar,常见于新闻客户端

JavaScript 100.00%

react-native-scrollable-topbar's Introduction

react-native-scrollable-topbar

基于React Native封装的资讯频道TopBar,常见于新闻客户端,具体实现功能如下:

  • TopBar区域可手动滑动(Underline 联动)
  • 点击频道实现内容区切换
  • 根据内容区(this.props.children)触摸手势实现频道切换
  • 频道位置校准,左右边界临界位置处理,实现自动滑动校准

Installation

npm install react-native-scrollable-topbar --save

Import into your project

import ScrollTopBar from "react-native-scrollable-topbar";

Examle useage

<ScrollTopBar
  topBarUnderlineStyle={{}}				                                                    // 下划线样式
  labelList={['推荐', '军事', '政治', '财经', '娱乐', '社会', '生活', '美食', '旅行']}			// 标题栏素材
  topBarInactiveTextColor={Colors.C5}		                                              // label 文字非选中颜色
  topBarActiveTextColor={Colors.CB}		                                                // label 文字选中颜色
  topBarBackgroundColor={Colors.C8}		                                                // 背景颜色
>
  {['推荐', '军事', '政治', '财经', '娱乐', '社会', '生活', '美食', '旅行'].map((e, i) => 
      <ArticleList key={i} index={i} navigation={this.props.navigation} /> 
  )}
</ScrollTopBar>

Properties

属性 描述 类型 默认
topBarUnderlineStyle 下划线样式 PropTypes.oneOfType([ ViewPropTypes.style, PropTypes.number ]) { backgroundColor: '#298eff', height: 4, width: 60, marginTop: -4 }
labelList 频道列表 PropTypes.array ['推荐', '军事', '政治', '财经', '娱乐', '社会', '生活', '美食', '旅行']
topBarInactiveTextColor 非活跃频道文字颜色 PropTypes.string '#aab9ca'
topBarActiveTextColor 活跃频道文字颜色 PropTypes.string '#298eff'
topBarBackgroundColor 背景颜色 PropTypes.string '#54657e'

react-native-scrollable-topbar's People

Watchers

James Cloos avatar

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.