【问题标题】:Can we stick the sticky header of sectionList (or a scrollView) to a relative position to the top of the scrollview?我们可以将sectionList(或滚动视图)的粘性标题粘贴到滚动视图顶部的相对位置吗?
【发布时间】:2019-03-25 04:36:32
【问题描述】:

当我们滚动 sectionList 时,我们可以将粘性标题粘贴在滚动视图的顶部。

但我需要在粘性标题和滚动视图顶部之间设置一个边距,即在滚动视图顶部之间留一个间隙。

有人知道怎么处理吗?

【问题讨论】:

    标签: reactjs react-native react-native-android


    【解决方案1】:

    在 iOS 中,我处理它的方式是在水平边距的同时添加另外两个道具

          contentContainerStyle={{
            marginHorizontal: 16,
          }}
          ListHeaderComponent={<View style={{ height: 16 }} />}
          ListFooterComponent={<View style={{ height: 16 }} />}
    

    这样可以确保标题会粘在顶部并且不会渗出内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多