GithubHelp home page GithubHelp logo

Comments (6)

czy1121 avatar czy1121 commented on August 24, 2024

不明白 "最后return了swiperefreshlayout",LoadingLayout.wrap返回的是LoadingLayout类型

wrap后有没有调用showXX?

我这边使用正常

from loadinglayout.

GhRyuJin avatar GhRyuJin commented on August 24, 2024

我Fragment的布局结构如下:

<SwipeRefreshLayout >
     <ListView />
 </SwipeRefreshLayout>

然后我用LoadingLayout.wrap(View view)方法传入了ListView,在onCreateView最后returnSwipeRefreshLayout,调用了showXXX方法了,但是还是没有效果,我的Fragment是Viewpager中的一个子项,我开始用的LoadingLayout.wrap(Fragment fragment)直接传入了fragment,但是在该方法中的fragment.getParent()返回了null崩溃,所以用了上一个方法

from loadinglayout.

czy1121 avatar czy1121 commented on August 24, 2024

LoadingLayout.wrap(Fragment fragment) 实际上是wrap(fragment.getView())
传入的view必须已经添加到布局中,也就是view.getParent()不能为null

你可以看下wrap源码,代码并不多

我在demo里添加了SwipeRefreshLayout+RecyclerView的例子,你试试看

from loadinglayout.

GhRyuJin avatar GhRyuJin commented on August 24, 2024

谢谢了,我看过源码的,直接使用swiperefreshlayout+RecyclerView应该是没有问题的,我的fragment是在viewpager里面的,这样貌似就有问题了哦

from loadinglayout.

wss991 avatar wss991 commented on August 24, 2024

是有这个问题的,在Viewpager中使用,就显示不出来,我觉得可能是viewpager的预加载的原因造成的

from loadinglayout.

yaozhengzheng avatar yaozhengzheng commented on August 24, 2024

我的是用的 swiperefreshlayout+listview,有多天数据的时候无法上下滑动,跟上啦加载,下啦刷新冲突了,可是demo上的不冲突,为啥

from loadinglayout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.