【发布时间】:2017-11-13 15:37:46
【问题描述】:
我正在开发应用程序信使,需要在缺少 Internet 的情况下动态显示“无连接”消息,例如在流行的信使(Viber 等)中。
它应该看起来像操作栏下方或选项卡下方的窄条。 动态添加此类视图的最佳方法是什么?是自定义的 SnackBar 还是 PopupWindow?
【问题讨论】:
标签: android user-interface popupwindow android-snackbar
我正在开发应用程序信使,需要在缺少 Internet 的情况下动态显示“无连接”消息,例如在流行的信使(Viber 等)中。
它应该看起来像操作栏下方或选项卡下方的窄条。 动态添加此类视图的最佳方法是什么?是自定义的 SnackBar 还是 PopupWindow?
【问题讨论】:
标签: android user-interface popupwindow android-snackbar
你可以用这个:
compile 'com.androidadvance:topsnackbar:1.1.1'
然后在代码中添加这个例子:
TSnackbar.make(findViewById(android.R.id.content),"no internet connection",TSnackbar.LENGTH_LONG).show();
这是上面的库,它在工具栏下添加了snackbars:
【讨论】: