滚动时Twowayview自动添加填充 [英] Twowayview automatically add padding when scrolling

查看:344
本文介绍了滚动时Twowayview自动添加填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Twowayview 在我的项目之一。这是机器人 Recyclerview 图书馆的延伸。滚动时(即,它会自动在每次滚动和atlast所有项目滚动到我们滚动边时添加填充)(有了像立式卧式交错,spannable网格和列表视图功能)。有时在GridView中的项目消失。这是一个随机行为没有遇到每一次。

I am using Twowayview in one of my projects. Which is an extension of androids Recyclerview library. (Having features like vertical horizontal staggered, spannable grid and listviews).Sometimes the items in the gridview disappears when scrolling (ie, It automatically adding padding each time it scrolls and atlast all items scroll to the side we scrolled). It was a random behavior not experiencing every time.

观看此视频, Recyclerview滚动发行

请找到关于这个问题下面这个链接,

Please find additional reference about this issue on this link below,

填充问题#140

这个自动填充问题,当我们添加或删除与新项目的适配器主要发生。

This auto padding issue mostly occur when we add or remove the adapter with new items.

请找我用下面的属性窗口小部件

Please find the widget i have used below with the attributes

<org.lucasr.twowayview.TwoWayView
android:id="@+id/spannable_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animationCache="false"
android:scrollbarAlwaysDrawHorizontalTrack="false"
android:scrollbarSize="0px"
android:scrollbars="none"
android:scrollingCache="false"
app:layoutManager="SpannableGridLayoutManager"
app:numColumn="6"
app:numRow="6" />

我找到了一些解决方案,如删除Twowayview,CliptoPadding等填充但这些工作对我来说。我使用Recyclerview版本21.0.0。任何人遇到此问题?如何解决这个问题呢?

I found some solutions like remove the padding from Twowayview, CliptoPadding , etc. But none of these working for me. I am using Recyclerview version 21.0.0. Anybody experiencing this issue ?. How to solve this issue ?

推荐答案

我重新张贴的答案伊什

首先让你必须使用双向-查看库code不是罐子。

First of all keep you must use code of TwoWay-View library not jar.

  1. 在库的开放式布局的文件夹。
  2. 在浏览包org.lucasr.twowayview.widget
  3. 开启BaseLayoutManager类
  4. 跳转到线路上没有。 362
  5. 您会发现code为

如果(anchorItemPosition> 0安培;&安培;!(refreshingLanes || restoringLanes))   {

if (anchorItemPosition > 0 && (refreshingLanes || !restoringLanes)) {

本替换该行

如果(anchorItemPosition> 0安培;&安培; refreshingLanes和放大器;&安培;!restoringLanes){ 以上变化BaseLayoutManager类的工作对我来说,作为解决上述问题。

if (anchorItemPosition > 0 && refreshingLanes && !restoringLanes) { Above change in BaseLayoutManager class work for me as a solution to above mentioned issues.

希望这会帮助你的所有双向-查看用户。

Hope this will help you all TwoWay-View users.

这篇关于滚动时Twowayview自动添加填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆