I have buttons displayed on the top of the screen (used react-native-scrollable-tab-view). Underneath the buttons, I have ListView
with section header on it.
Is there a way to get the header to stick to the bottom edge of the tab-view when I am scrolling?
I have had a hard time trying to get ListView
's section header to stick to the bottom of Facebook TabBar, and its default is to stick to the top of the screen.
When I scroll, the section header slides under the tab-bar.
Any thoughts on this? Is there anything I should change in FacebookTabBar.js to make this work?
Without tab bar at the top
With tab bar at the top
Note: It is strange how this GIF does not show the full animation correctly; you can imagine that the list is scrolled a lot and the section header slides under the tab bar.
Section header styles
catListHeaderContainer: {
padding: 12,
backgroundColor: '#1F2036',
}
FacebookTabBar styles
var styles = StyleSheet.create({
tab: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingBottom: 10,
},
tabs: {
height: 60,
flexDirection: 'row',
paddingTop: 5,
borderWidth: 0,
borderTopWidth: 0,
borderLeftWidth: 0,
borderRightWidth: 0,
borderBottomColor: 'rgba(0,0,0,0)',
},
activeTabTitle: {
marginTop: 40,
color: '#3B5998',
},
nonActiveTabTitle: {
marginTop: 40,
color: '#BDBDBD',
},
});
Right now if you take a look at this code, you may notice that
Category
is a direct child ofScrollView
(the tag withtabTitle='Search'
).My attempt to make this work was to let
View
be the direct child ofScrollView
and writeCategory
as the child ofView
.Then I styled
View
in the following way:This seems to have solved the problem partially. Partially, because for example, if I click Cell 2 and then pull the list up, the list view scrolls properly, and the section headers stick in the way that I expect.
However, if I initially click (continuously holding down the mouse button) and pull down the list and then try pulling it up after that, the list and its section header slide behind the tab bar thus showing the original behavior, which is not what I want to see.
Pulling up the list
Initially pulling down, and then pulling up the list