PedroBern / react-native-collapsible-tab-view

A cross-platform Collapsible Tab View component for React Native
MIT License
827 stars 160 forks source link

revealHeaderOnScroll not work #312

Open ghshgd opened 1 year ago

ghshgd commented 1 year ago

When I use revealHeaderOnScroll On Tabs.Container, it doesn't work. bellow is my code. App.js

import {ScrollView, View} from 'react-native'
import PostListOfUserScreen from './components/PostListOfUserScreen';

export default function App() {

return (
    <ScrollView>
      <View style={{height: 4000}}>
      <PostListOfUserScreen/>
      </View>
    </ScrollView>
  )

}

PostListOfUserScreen.js

import {View} from 'react-native'
import {Tabs} from 'react-native-collapsible-tab-view'
export default function PostListOfUserScreen() {

    const Header = () => {
        return <View style={{
            height: HEADER_HEIGHT,
            width: '100%',
            backgroundColor: '#2196f3',
          }} />
    }
    return (
        <Tabs.Container renderHeader={Header}
            revealHeaderOnScroll={true}>
            <Tabs.Tab name="A">
                <Tabs.ScrollView>
                    <View style={{height: 1000, width: 400, backgroundColor: 'red'}}/>
                    <View style={{height: 1000, width: 400, backgroundColor: 'green'}}/>
                    <View style={{height: 1000, width: 400, backgroundColor: 'blue'}}/>
                </Tabs.ScrollView>
            </Tabs.Tab>
            <Tabs.Tab name="B">
                <Tabs.ScrollView>
                <View style={{height: 1000, width: 400, backgroundColor: 'grey'}} />
                <View style={{height: 1000, width: 400, backgroundColor: 'black'}} />
                </Tabs.ScrollView>
            </Tabs.Tab>
        </Tabs.Container>
      )
}

KakaoTalk_20230101_162404756_01 KakaoTalk_20230101_162404756

kailingding commented 1 year ago

any updates on this issue?