简体   繁体   English

希望 ListView 允许点击通过或在偏移处启动 ListView 但向上滚动以覆盖图像

[英]Want ListView to allow taps to pass though or start ListView at offset but scroll up to cover image

I'm trying to achieve an effect where:我正在尝试达到以下效果:

  1. There is an interactive carousel image at the top顶部有一个交互式轮播图像
  2. There is a ListView at the middle to bottom.中间到底部有一个 ListView。
  3. When you scroll the list view, it scrolls up and covers the carousel images (the images stay in place)当您滚动列表视图时,它会向上滚动并覆盖轮播图像(图像保持原位)

I've tried using a Stack and the ListView covering the screen but with a spacer as the first child to expose the image behind it.我尝试使用 Stack 和 ListView 覆盖屏幕,但使用垫片作为第一个子项来暴露其后面的图像。 But this stops touches from passing through.但这会阻止触摸通过。

It sounds like you'd need to use a CustomScrollView and Slivers.听起来您需要使用 CustomScrollView 和 Slivers。

There's good documentation for both including examples here: https://api.flutter.dev/flutter/material/SliverAppBar-class.html两者都有很好的文档,包括此处的示例: https://api.flutter.dev/flutter/material/SliverAppBar-class.html

https://docs.flutter.dev/development/ui/advanced/slivers https://docs.flutter.dev/development/ui/advanced/slivers

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 图片未显示在 ListView 中 - Image not showing up in ListView 我想在 ListView 的所有子项都向上滚动后向上滚动,listview 的父小部件是 flutter 中的 SingleChildScrollView - I want to scroll up after the all childs of ListView have been scrolled up, parent widget of listview is SingleChildScrollView in flutter 如何启动填充的列表视图以从顶部开始颤动? 当我不想要它时,填充的列表视图会向上推容器 - How to start a populated listview to start at top with flutter? Populated listview pushes up container when I don't want it to 在应用程序开始时滚动到颤动中列表视图的最后一个元素 - On start of app scroll to last element of listview in flutter Flutter ListView - 如何在底部开始滚动 - Flutter ListView - how to start scroll at the bottom 向上/向下滚动时,ListView滞后 - ListView lagging while scroll up/down Flutter:ListView with StreamBuilder Janky on Scroll Up - Flutter: ListView with StreamBuilder Janky on Scroll Up 如何让 ListView 组件在 TextFieldInput 上向上滚动 - How to get ListView Component to scroll up on TextFieldInput Flutter ListView、SliverList 等中的当前滚动偏移 - Current scroll offset inside a Flutter ListView, SliverList,etc 从 ListView 或其他 Scroll Widget (Flutter) 检测 Scroll 的开始 - Detect start of Scroll from ListView or other Scroll Widget (Flutter)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM