Coder Social home page Coder Social logo

zyslife / react-native-head-tab-view Goto Github PK

View Code? Open in Web Editor NEW
425.0 5.0 80.0 21.61 MB

Add collapsible headers to your tab-view components.

JavaScript 1.93% Starlark 1.48% Java 5.02% Ruby 0.63% Objective-C 3.41% TypeScript 87.54%
react-native tabs tabbar swipe swipeview collapsable header

react-native-head-tab-view's People

Contributors

dependabot[bot] avatar zyslife avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-native-head-tab-view's Issues

testID props are lost

Hi

I use FlatList wrapped into HPageViewHoc

and looks like testID props has been lost, can you take a look and provide it?

Option to lock horizontal sliding on first and last tabs

Right now you can slide left on the first tab and slide right on the last tab, it will do nothing but bounce horizontally.

It would be nice to have an option to lock the sliding on those directions of the respective tabs(the locked props on TabView will lock all directions)

ScrollView.prototype undefined不兼容

HPageViewHoc 217行报错

return WrappedComponent.prototype.hasOwnProperty(scrollName)

ScrollView.prototype undefined

环境
"react": "16.13.1", "react-native": "0.63.2",

头部无法滑动

我已经把headerRespond设置为true,可是当我往上滑头部一直在原地不会变小

触摸事件,列表滚动停止

当从列表向上滑动到头部区域, 当列表在滚动缓冲时, 再次触摸头部区域, 要使其列表立刻停止滚动。就像单纯当列表一样,这块还需要处理。

README 说明修改建议

npm install @react-native-community/viewpager --save
这一步建议在README里仿照其他rn库说明添加手动导入说明(或者引导去看@react-native-community/viewpager github README的导入说明)

以及针对安卓端下使用@react-native-community/viewpager版本, 做个说明, :
2.x版本是用的Android support可用于rn0.59以下版本
3.x版本是用的AndroidX的, 可用于rn0.60以上版本

添加renderRightView时,tab滑动状态有问题

现象:有个需求是在tab右侧添加一个排序按钮。我添加renderRightView后,tab滑动到了Index = 1,但是位置1的tab并没有进入高亮状态。去掉renderRightView,一切正常

Documentation

Hello bro!

Thanks for providing such a cool component. I've already created something for my personal goals in my previous project but didn't share it. Now I wanted to find out something already written - to not copy and paste this from other my app and found your solution.

If you are not going to merge it into the react-native-tab-view project, so please think about good docs/readme in English.

左右滑手势冲突

tabs里嵌套flatlist,flatlist每个item有点击事件,左右滑动的时候会触发点击事件,这个怎么解决

如何回到顶部

子页面里面的列表滑动到第2页或者n页, 通过哪个方法回到顶部?

Tabbar 样式问题

大佬,请问我使用的 简例的例子后

import { HPageViewHoc, TabView } from 'react-native-head-tab-view'

_renderScene = (sceneProps: { item: string, index: number }) => {
        const { item } = sceneProps;
        if (item == 'ScrollView') {
            return <Page1 {...sceneProps} />
        } else if (item == 'FlatList') {
            return <Page2 {...sceneProps} />
        } else if (item == 'SectionList') {
            return <Page3 {...sceneProps} />
        }
        return null;
}
    
render() {
        return (
            <View style={{ flex: 1, backgroundColor: '#FFF' }}>
                <StatusBar
                    barStyle={'dark-content'}
                    translucent={true}
                />
                {this._renderNavBar()}
                <TabView
                        tabs={this.state.tabs}
                        renderScene={this._renderScene}
                        makeHeaderHeight={() => { return 180 }}
                        renderScrollHeader={()=><View style={{height:180,backgroundColor:'red'}}/>}
                        onChangeTab={this.onChangeTab}
                    />
            </View>
        )
    }

如何去掉 Tabbar 下划线或者更改下划线样式呢

探讨下如何修复下刷新控件位置,或者自定义下拉刷新控件

我试了以下方案
1、onScroll去监听 不用自带的刷新功能 使用自定义 ios能监听到负值 也就是到顶部了还可以继续下拉可以做到自定义刷新 但是Android不可以 最多到顶部就不能下拉了 只能监听到0 结论 ios可以 安卓不行

2、 添加手势监听滑动距离,使用rn自带手势:结论 不行手势功能只能监听到几个值就会被scrollview的滑动所替换;
使用第三方手势控件,可以做到监听任何时候的滑动坐标以及距离,但是tab左右切换受到影响,不能左右滑动了,如果能解决左右滑动的问题,估计能实现。

3、因为rn自带的刷新控件,不支持修改样式,没有暴露原生的全部方法,这里Android的刷新控件有一个方法是修改距离顶部的高度的,所以考虑封装原生自定义控件。 不过不懂原生, 搞了一半实在是不懂了

Buttons/Touchable Opacity/Pressable on the bottom half of renderHeader doesn't receive onPress event

Only the top ~100 px receives a touch event. If I have a button at y = 20px, it is clickable. If the button is at y = 150px, it is not clickable, UNTIL I scroll up so that button is within around the top 100px area.

Looks like the HPageView has a transparent area covering the header? I tried increasing zIndex of the header but it still doesn't work. I'll take a look at the source code if I get the time too, but maybe you know why this is happening?

如何配置 tabbar item 样式

代码如下

<TabView
        tabs={['aaa', 'bbb']}
        underLineHidden={true}
        renderScene={_renderScene}
        headerRespond={false}
        makeHeaderHeight={() => { return 220 }}
        tabsContainerStyle={{
          marginHorizontal: 15,
          borderColor: '#14AC69',
          borderWidth: 1,
          alignItems: 'center',
          paddingVertical: 10,
          borderTopLeftRadius: 10,
          borderBottomLeftRadius: 10,
          borderTopRightRadius: 10,
          borderBottomRightRadius: 10,
        }}
        tabbarStyle={{
          // borderBottomWidth: 0,
        }}
        activeTextStyle={{
          fontSize: 20,
          backgroundColor: '#14AC69',
        }}
        underLineHidden={true}
        inactiveTextStyle={{ fontSize: 20, backgroundColor: '#333', }}
        renderScrollHeader={() => (
          <View>
            <View style={styles.listHeader}>
              <Text>统计日期: 2020-06-16</Text>
              <IconFont
                name="message"
                size={20}
                onPress={() => navigation.navigate('SaleNormDescription')} />
            </View>
            <WhiteSpace />
            <WingBlank>
              <InfoCard
                tipName='销售监控'
                monthTarget={12878666.66}
                yearTarget={12878666.66} />
            </WingBlank>
          </View>
        )}
        onChangeTab={onChangeTab}
      />

代码如上, 添加underLineHidden={true} 等 tabbar 属性后都无效.

新功能

老哥,啥时候能添加头部和列表整体下拉功能?感觉现在的这种下拉不是很常用。

滚动跳跃

gif 图太大了, 传到cdn 了, https://imgs.wuazhu.cn/imgs/Kapture%202020-06-28%20at%2017.58.50_quaL8n.gif

问题: 如何固定滚动的生效区域, 就是我看 demo 的下拉加载都是在 tabbar 以下开始, 我的菊花都是从页面顶部开始, 这个是否跟 makeHeaderHeight 设置有关? 另一个页面的makeHeaderHeight是 200, 但是加载也是从页面顶部开始.

另一个是会产生连带滚动, 并且需要再次拖动才能回到原位

代码如下:

<TabView
      tabs={tabs}
      makeHeaderHeight={() => 44}
      activeTextStyle={{ color: '#333', fontSize: 22, fontWeight: '900' }}
      inactiveTextStyle={{ color: '#999', fontSize: 22, }}
      averageTab={false}
      renderScene={_renderScene}
      renderTabBar={(tabbarProps) => (
        <Tabbar
          {...tabbarProps}
          underLineHidden={true}
          style={{ borderBottomWidth: 0, }}
        />
      )}
      renderScrollHeader={() => <SearchInput style={{ height: 44 }} />}>
    </TabView>

Detect when header is disappear

hello

i'd like to do something when header is disappeared because i scroll up.

so i tried to use onScroll function in HPageViewHoc(FlatList) to get scroll value. but it was duplicated.

is there way to detect the moment or get scroll value of HPageViewHoc(FlatList)?

please help me!!

页面结构样式错乱

当tab切换页只有少量数据时。切换页面后样式错乱。在安卓手机(华为)手机在tab首页整个页面无法滑动。麻烦请大佬看一下。 @zyslife

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.