【问题标题】:The best way to implement showing "No Connection" message throughout the app在整个应用程序中显示“无连接”消息的最佳方式
【发布时间】:2017-11-13 15:37:46
【问题描述】:

我正在开发应用程序信使,需要在缺少 Internet 的情况下动态显示“无连接”消息,例如在流行的信使(Viber 等)中。

它应该看起来像操作栏下方或选项卡下方的窄条。 动态添加此类视图的最佳方法是什么?是自定义的 SnackBar 还是 PopupWindow?

【问题讨论】:

    标签: android user-interface popupwindow android-snackbar


    【解决方案1】:

    你可以用这个:

    compile 'com.androidadvance:topsnackbar:1.1.1'
    

    然后在代码中添加这个例子:

    TSnackbar.make(findViewById(android.R.id.content),"no internet connection",TSnackbar.LENGTH_LONG).show();
    

    这是上面的库,它在工具栏下添加了snackbars:

    https://github.com/AndreiD/TSnackBar

    【讨论】:

    • @H.Brooks 是的,它不依赖于工具栏,它只是一个顶级小吃店,TSnackbar= 顶级小吃店
    • 我投了赞成票,我认为是人们无事可做。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-26
    • 1970-01-01
    • 1970-01-01
    • 2018-05-12
    • 1970-01-01
    • 2012-11-04
    相关资源
    最近更新 更多