How to Get ListView Section Header to Stick

后端 未结 2 1465
礼貌的吻别
礼貌的吻别 2021-01-30 15:17

I have buttons displayed on the top of the screen (used react-native-scrollable-tab-view). Underneath the buttons, I have ListView with section hea

2条回答
  •  遇见更好的自我
    2021-01-30 15:46

    Right now if you take a look at this code, you may notice that Category is a direct child of ScrollView (the tag with tabTitle='Search').

    My attempt to make this work was to let View be the direct child of ScrollView and write Category as the child of View.

    
      
        
      
    
    

    Then I styled View in the following way:

    categoryContain: {
      top: 0,
      height: deviceHeight,
    },
    

    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

    enter image description here

    Initially pulling down, and then pulling up the list

    enter image description here

提交回复
热议问题