【问题标题】:How to show SnackBar In android for Pre-Lollipop Device?如何在 android 中为 Pre-Lollipop 设备显示 SnackBar?
【发布时间】:2015-09-26 20:33:45
【问题描述】:

我遇到了麻烦,我无法在 android 中显示 Snackbar 如何在 Android 中为 Pre-Lollipop 设备显示 SnackBar?

【问题讨论】:

  • 在询问 SO 问题之前请先 google,搜索会产生大量关于此主题的结果。
  • 对不起,但是....我用过,但它显示 classnot found 异常,这就是我问这个问题的原因

标签: android


【解决方案1】:

看看新的Material Design compatibility library。它具有用于棒棒糖前设备的 SnackBar。

你的 gradle 依赖是:compile 'com.android.support:design:22.2.0'

编辑

如果您使用的是eclipse,请按照官方页面的说明进行操作:

下载 Android 支持库后,该库位于 >/extras/android/support/design 目录中。有关如何设置项目的更多信息,请按照Adding libraries with resources 中的说明进行操作。

【讨论】:

  • 对不起,我用过 Eclips
  • 在这种情况下,您可以下载 jar 并将其放在 libs 文件夹中。此存储库是公开的。
猜你喜欢
  • 2015-09-18
  • 1970-01-01
  • 1970-01-01
  • 2015-10-26
  • 1970-01-01
  • 1970-01-01
  • 2015-12-11
  • 2016-01-07
  • 1970-01-01
相关资源
最近更新 更多