barryhappy
V2EX  ›  Android

开发 Android 的同学们,你们平时是怎么设置那么多 EmptyView 的?

  •  
  •   barryhappy · Jul 5, 2016 · 14967 views
    This topic created in 3603 days ago, the information mentioned may be changed or developed.

    有很多页面都要设置 EmptyView 的话,有哪些能简化工作的技巧?


    另外,[弱弱地] 打个小广告,我写了个设置 emptyView 的小轮子,比较简单(jian lou)。但可以免去每次都要写 xml 的痛苦,支持 ListView 、 GridView 、 RecyclerView~
    TEmptyViewhttps://github.com/barryhappy/TEmptyView

    点链接过去瞅瞅?

    6 replies    2016-07-05 16:06:50 +08:00
    Zxw
        1
    Zxw  
       Jul 5, 2016 via Android
    data binding xml 直接设置 EmptyView
    torchmu
        2
    torchmu  
       Jul 5, 2016
    公司用的 loading 、 empty 、 error 一体的,不过楼主这个没看到怎么隐藏 emptyview ?
    barryhappy
        3
    barryhappy  
    OP
       Jul 5, 2016
    @torchmu listView 有数据的时候, EmptyView 就会自动隐藏~
    后面会考虑加上不同状态下不同 EmptyView 设置~
    kitalphaj
        4
    kitalphaj  
       Jul 5, 2016
    @torchmu 嗯,这种方式我也在用,但是感觉还是挺麻烦的。
    fashioncj
        5
    fashioncj  
       Jul 5, 2016
    我在外包中直接在底层写这个- -然后上面一个 listview 覆盖。。 size=0 就显示后面的 ==
    qzrsaaa
        6
    qzrsaaa  
       Jul 5, 2016
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1568 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 16:24 · PVG 00:24 · LAX 09:24 · JFK 12:24
    ♥ Do have faith in what you're doing.