V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
hinkal
V2EX  ›  Android

非列表布局的下拉刷新怎么做啊

  •  
  •   hinkal · Jun 5, 2016 · 13923 views
    This topic created in 3613 days ago, the information mentioned may be changed or developed.
    android support 库中的下拉刷新是给列表布局用的。但在 android 版的 chrome 中看到非列表的网页也能下拉刷新。请问怎么做。
    6 replies    2016-06-06 12:38:51 +08:00
    TVBG
        1
    TVBG  
       Jun 5, 2016
    简单的方法就是在显示的 View 上面套一层 NestedScrollView
    Tneciv
        2
    Tneciv  
       Jun 6, 2016 via Android
    谁告诉你 support 中的下拉刷新只能给列表布局用的?
    hinkal
        3
    hinkal  
    OP
       Jun 6, 2016
    @Tneciv 我看官方文档 https://developer.android.com/training/swipe/add-swipe-interface.html 中提到“ Remember that SwipeRefreshLayout only supports a single ListView or GridView child.”难道理解错了...
    kitalphaj
        4
    kitalphaj  
       Jun 6, 2016
    @hinkal 只要是 ScrollView 都可以
    kitalphaj
        5
    kitalphaj  
       Jun 6, 2016
    准确的说应该是 Scrollable...
    torchmu
        6
    torchmu  
       Jun 6, 2016
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1751 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 00:00 · PVG 08:00 · LAX 17:00 · JFK 20:00
    ♥ Do have faith in what you're doing.