首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Biubiu说

    谷歌地图与 NestedScrollView 滑动冲突

    com.google.android.gms.maps.SupportMapFragment; /** * @author: heliquan * @data: 2019/1/11 * @desc: 解决谷歌地图与 NestedScrollView 滑动冲突 * https://stackoverflow.com/questions/41689968/google-map-fragment-scrolling-inside-nestedscrollview

    1.7K20发布于 2019-03-19
  • 来自专栏iOS开发~

    iOS_NestedScrollView(嵌套ScrollView)

    首先需要了解UIGestureRecognizerDelegate协议的这个方法:

    1.4K30编辑于 2022-09-08
  • 来自专栏Flutter

    Flutter 首页必用组件NestedScrollView

    今天介绍的组件是NestedScrollView,大部分的App首页都会用到这个组件。 NestedScrollView 可以在其内部嵌套其他滚动视图的组件,其滚动位置是固有链接的。 滚动隐藏AppBar 比如实现如下场景,当列表滚动时,隐藏AppBar,用法如下: NestedScrollView( headerSliverBuilder: (BuildContext context (color: Colors.white, fontSize: 20), ), ); },itemCount: 20,), ) 效果如下: SliverAppBar展开折叠 用法如下: NestedScrollView TextStyle(color: Colors.white, fontSize: 20), ), ); },itemCount: 20,), ) 效果如下: 与TabBar配合使用 用法如下: NestedScrollView SliverPersistentHeaderDelegate oldDelegate) { return true; } } 效果如下: 其他属性 通过scrollDirection和reverse参数控制其滚动方向,用法如下: NestedScrollView

    5.1K10发布于 2020-09-11
  • 来自专栏Android 开发学习

    NestedScrollView 嵌套 ListView 实现滑动折叠效果

    本文试着采用 NestedScrollView 嵌套 ListView的方法来实现折叠效果。具体结果如图所示: ? " android:id="@+id/list" /> </LinearLayout> </android.support.v4.widget.NestedScrollView layout_collapseMode,pin表示不动,parallax视差效果 将 app:layout_behavior="@string/appbar_scrolling_view_behavior"指定给NestedScrollView 解决NestedScrollView嵌套listView问题。 貌似网上一抓一大把,本文采用其中之一方案,复写listView。 private void adjustParentView() { //兼容NestedscrollView int actionBarHeight = 0; TypedValue tv

    4.2K50发布于 2018-06-06
  • 来自专栏懒人开发

    CoordinatorLayout使用(三):NestedScrollView & 嵌套滑动事件

    简单了解 有一个类,叫 NestedScrollView: ? NestedScrollView 直接从源码看,可以知道, 它既是一个 NestedScrollingChild 也是一个 NestedScrollingParent 换句话说, 即可以 接收事件, ---- 嵌套滑动事件 简单实例 注意: 这里是用 事件流中 嵌套滑动事件 去处理的 我们可以用NestedScrollView做事件发送,给外面的Parent发事件, 再传递给Behavior 效果 我们可以得到, 右边 滑动,左边随着滑动 左边单独滑动,右边不动 和前面提到的逻辑是一样的, 因为Parent会传递给左边 ---- 再添加一个NestedScrollView 我们知道 NestedScrollView 可以发送事件给外面的Parent, 也就是CoordinatorLayout 那如果我们再添加一个 NestedScrollView 那应该都可以发送滑动事件 <?

    11.4K40发布于 2018-09-12
  • 来自专栏史上最简单的Spring Cloud教程

    NestedScrollView和RecyclerView使用,并设置间距

    NestedScrollView和RecyclerView使用,并设置间距: 效果图如下: 1.NestedScrollView 和RecyclerView嵌套问题(类似ScrollView } catch (Exception e) { e.printStackTrace(); } } } } 重写NestedScrollView ,实际上是NestedScrollView禁止滑动 public class MyNestedScrollView extends NestedScrollView { private int

    1.3K30编辑于 2022-11-30
  • 来自专栏哈利迪ei

    踩坑记 | Flutter升级影响了NestedScrollView

    嗨,我是哈利迪~最近有个bug排查了好几天,就是有个老页面因业务复杂度,使用了NestedScrollView+tab+多Fragment的结构(各Fragment里有RecyclerView,即存在嵌套滑动 果然对NestedScrollView进行了改动,看一下这个类: 1.0.0: class NestedScrollView extends FrameLayout implements NestedScrollingParent2 NestedScrollView 简析 那么接下来我们来看看1.1.0里NestedScrollView都改了写啥,先来捋下NestedScrollView的继承关系: [007S8ZIlly1ghf3b0k2voj316a0pedjc.jpg [007S8ZIlly1ghf2ej40ryj306406aabd.jpg] 代码仅供演示,非必要情况下并不推荐NestedScrollView和RecyclerView的嵌套。 相比NestedScrollView,RecyclerView只实现了NestedScrollingChild2,在嵌套滑动体系里只能作为子布局存在,所以下面以RecyclerView为子,NestedScrollView

    1.2K00发布于 2020-08-07
  • 来自专栏哈利迪ei

    踩坑记 | Flutter升级影响了NestedScrollView

    嗨,我是哈利迪~最近有个bug排查了好几天,就是有个老页面因业务复杂度,使用了NestedScrollView+tab+多Fragment的结构(各Fragment里有RecyclerView,即存在嵌套滑动 果然对NestedScrollView进行了改动,看一下这个类: 1.0.0: class NestedScrollView extends FrameLayout implements NestedScrollingParent2 NestedScrollView 简析 那么接下来我们来看看1.1.0里NestedScrollView都改了写啥,先来捋下NestedScrollView的继承关系: ? 代码仅供演示,非必要情况下并不推荐NestedScrollView和RecyclerView的嵌套。 相比NestedScrollView,RecyclerView只实现了NestedScrollingChild2,在嵌套滑动体系里只能作为子布局存在,所以下面以RecyclerView为子,NestedScrollView

    1.1K20发布于 2020-08-10
  • 来自专栏设计模式

    Flutter入门指北(Part 8)之Sliver 组件及NestedScrollView

    以上部分代码查看 sliver_main.dart 文件 NestedScrollView 讲到这了,不得不提下 Scrollable 中比较重要的一员 NestedScrollView,先看下官方的解释 看下 headerSliverBuilder 的定义 /// Signature used by [NestedScrollView] for building its header. /// /// = null, 'NestedScrollView.sliverOverlapAbsorberHandleFor must be called with a context that contains a NestedScrollView.'); return target.state. must be called with a context that contains a NestedScrollView. .map((tab) =>

    2.8K30发布于 2020-12-16
  • 来自专栏flutter开发中的点滴积累

    Flutter NestedScrollView实现的一个经典滑动折叠头部图片的效果

    Flutter NestedScrollView 滑动组件是用来处理复杂情况下的滑动应用场景,如向上滑动视图时,要折叠隐藏一部分内容,这时候就需要使用到 NestedScrollView 与 SliverAppBar 在本节中是使用 NestedScrollView 结合 SliverAppBar 与 TabBar 、TabBarView 实现的折叠头部效果undefined 【x1】微信公众号的每日提醒 随时随记 /// 处理滑动 body: buildNestedScrollView(), ); } buildNestedScrollView 方法就是构建了一个滑动布局 NestedScrollView ,其中两部分,头部使用的是 SliverAppBar 来触发折叠效果, body 用来配置页面主体部分,代码如下: ///构建滑动布局 ///如下图1-1所示 NestedScrollView buildNestedScrollView() { return NestedScrollView( headerSliverBuilder: (BuildContext context

    3.2K11发布于 2020-10-08
  • 来自专栏用户9239674的专栏

    不一样角度带你了解 Flutter 中的滑动列表实现

    NestedScrollView 为什么会把 NestedScrollView 单独拿出来说呢?这是因为 NestedScrollView 和前面介绍的滑动列表实现不大一样。 如下代码所示,这是使用 NestedScrollView 常用的模式,那有看出什么特别的地方了吗? SliverList 组合,而 NestedScrollView 本身也有 NestedScrollViewViewport。 「所以 NestedScrollView 的实现本质上其实就是 Viewport 嵌套 Viewport,会有两个 Scrollable 的存在」 ,并且嵌套的  ListView 是被放在了 NestedScrollView 「这就要说到 NestedScrollView 里的 _NestedScrollCoordinator 对象。」

    1.5K30编辑于 2021-12-29
  • 来自专栏android自用

    Android之ScrollView和RecyclerView滑动冲突问题,GridView在NestedScrollView失去高度显示不全,

    ScrollView和RecyclerView滑动冲突问题方法1:我们可以把scrollview换成androidx.core.widget.NestedScrollView<com.scwang.smartrefresh.layout.SmartRefreshLayout -- 传统scrollview和RecyclerView滚动冲突 --> <androidx.core.widget.NestedScrollView android:layout_width android:paddingHorizontal="5dp" android:visibility="visible" /> </androidx.core.widget.NestedScrollView canScrollVertically() { return false; }});如果无法解决,在布局文件中的RecycleView的外部套一个RelativeLayoutGridView在NestedScrollView

    2.1K80编辑于 2023-05-26
  • 来自专栏移动开发之家

    不一样角度带你了解 Flutter 中的滑动列表实现

    NestedScrollView 为什么会把 NestedScrollView 单独拿出来说呢?这是因为 NestedScrollView 和前面介绍的滑动列表实现不大一样。 内部组成 ? 如下代码所示,这是使用 NestedScrollView 常用的模式,那有看出什么特别的地方了吗? ? 组合,而 NestedScrollView 本身也有 NestedScrollViewViewport。 所以 NestedScrollView 的实现本质上其实就是 Viewport 嵌套 Viewport,会有两个 Scrollable 的存在 ,并且嵌套的 ListView 是被放在了 NestedScrollView 这就要说到 NestedScrollView 里的 _NestedScrollCoordinator 对象。

    2.7K51发布于 2021-04-30
  • 来自专栏老欧说安卓

    Android开发笔记(一百三十五)应用栏布局AppBarLayout

    RecyclerView是其中一个特工,它可用来替代ListView和GridView;替代ScrollView的则另有其人,它便是嵌套滚动视图NestedScrollView,在Android5.0之后的 NestedScrollView继承自FrameLayout,其用法与ScrollView相似,如都必须且只能带一个直接子视图,都是允许视图上下滚动等等。 NestedScrollView多出来的功能,也就是跟AppBarLayout配合使用,以便触发Toolbar的滚动行为,你可以把它当作是兼容了Android5.0新特性的增强版ScrollView。 下面是AppBarLayout结合NestedScrollView实现的工具栏向上滚动效果截图: ? > </android.support.design.widget.CoordinatorLayout> 话说除了RecyclerView和NestedScrollView,还有哪些控件可以触发

    2.9K40发布于 2019-01-18
  • 来自专栏半行代码

    聊聊Android嵌套滑动

    RecyclerView 为例: 嵌套滑动我们最先接触到的可能就是 NestedScrollView 这个控件了,那么它是怎么支持嵌套滑动的呢? 这样 NestedScrollView 里面的view 才可能完全跟着一起滑动。 这些都是 NestedScrollView里面的 NestedScrollingChildHelper 对象完成的。 onNestedPreScroll的逻辑就和 onStartNestedScroll非常类似了: 假设还是 NestedScrollView外层套了NestedScrollView: dispatchNestedPreScroll 不全是,最常见的比如 NestedScrollView 包裹 RecyclerView ,这时候 NestedScrollView 会把 UNSPECIFIED 传递给 RecyclerView 的 onMeasure

    1.8K10编辑于 2022-05-10
  • 来自专栏懒人开发

    CoordinatorLayout使用(四):和Toolbar的简单使用

    --app:layout_behavior="@string/appbar_scrolling_view_behavior"--> <android.support.v4.widget.NestedScrollView 再给Toolbar添加一个 app:layout_scrollFlags="scroll|snap|enterAlways" 还有对应的android.support.v4.widget.NestedScrollView 要和Toolbar互动的话(CollapsingToolbarLayout等之后在了解,这里不涉及) 需要注意几点 外面先要添加AppBarLayout来接收Behavior 再要注意给NestedScrollView a5.gif 这里也比较简单, Toolbar添加app:layout_scrollFlags="scroll" 主体NestedScrollView添加app:layout_behavior="@string a5-2.gif 大体就这样了 代码见后面的地址 ---- 简单小节 CoordinatorLayout中,NestedScrollView和Toolbar联动 注意Toolbar外面要套AppBarLayout

    1.8K30发布于 2018-09-12
  • 来自专栏Android、鸿蒙开发

    Android 天气APP(十)继续优化、下拉刷新页面天气数据

    可以看到我在androidx.core.widget.NestedScrollView的外层嵌套了一个com.scwang.smartrefresh.layout.SmartRefreshLayout( --NestedScrollView 里面只能包裹一个大的布局, 当这个布局长度超出手机展示的部分就可以滚动,其中overScrollMode="never" 的意思是隐藏掉滚动条到顶部和底部时的水波纹--> <androidx.core.widget.NestedScrollView android:layout_height="match_parent"> </androidx.core.widget.NestedScrollView

    1.3K30发布于 2020-09-25
  • 来自专栏Android、鸿蒙开发

    Android 折叠式布局

    为了使体现更好可以AppBarLayout下面放一个滚动条,不要用ScrollView而是NestedScrollView因为这里你是要联动的。 不论是ScrollView还是NestedScrollView,里面都只能包裹一个控件,我常用的是LinearLayout 然后LinearLayout里面设置纵向排列,放三张图片,这样LinearLayout 的总高度就会超过手机屏幕,形成滑动之后图片向上面展示的效果,其实加了NestedScrollView之后,即使里面什么东西都没有,你照样可以滚动,但是如果你用ScrollView就不行,它里面就必须要有东西才行 layout_height="50dp"/> </android.support.design.widget.AppBarLayout> <android.support.v4.widget.NestedScrollView android:layout_height="300dp"/> </LinearLayout> </android.support.v4.widget.NestedScrollView

    1.7K20发布于 2020-09-25
  • 来自专栏Code

    Android解决RecyclerView中的item显示不全方案

    下面来说两种解决方案: 1、使用5.0的新控件NestedScrollView替换ScrollView. NestedScrollView支持嵌套滑动,既能填item显示不全的坑,又可以填嵌套滑动卡顿的坑。不了解的童鞋可以去学习一波,这里就不做详细的说明了。 用法: (1)、布局文件中将ScrollView替换成"android.support.v4.widget.NestedScrollView".

    8.8K40发布于 2019-08-07
  • 来自专栏Code

    Android解决RecyclerView中的item显示不全方案

    下面来说两种解决方案: 1、使用5.0的新控件NestedScrollView替换ScrollView. NestedScrollView支持嵌套滑动,既能填item显示不全的坑,又可以填嵌套滑动卡顿的坑。不了解的童鞋可以去学习一波,这里就不做详细的说明了。 用法: (1)、布局文件中将ScrollView替换成"android.support.v4.widget.NestedScrollView".

    3.7K30发布于 2021-09-07
领券