Anko: snackbar & longSnackbar are not working at all

Created on 16 Feb 2018  路  4Comments  路  Source: Kotlin/anko

Using version 0.10.4

button("Click Me!") {
                onClick { snackbar("You just clicked me.") }
            }.lparams(width = wrapContent, height = wrapContent) {
                gravity = Gravity.CENTER
            }

Unresolved reference: snackbar

Most helpful comment

That didn't work either.
But I found the solution.
Turns out adding the org.jetbrains.anko:anko:$anko_version doesn't include the Snackbar.
Added org.jetbrains.anko:anko-design:$anko_version and it is now working fine.

All 4 comments

Snackbar takes two parameters, the first is View, the second is the message

Just tried that too. Not working.

Had the same issue with the same version (0.10.4). I added a .show() and now it works.

Try like snackbar(view, "You just clicked me.").show()

That didn't work either.
But I found the solution.
Turns out adding the org.jetbrains.anko:anko:$anko_version doesn't include the Snackbar.
Added org.jetbrains.anko:anko-design:$anko_version and it is now working fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SuleymanovTat picture SuleymanovTat  路  4Comments

GeorgiyShur picture GeorgiyShur  路  4Comments

evansherry picture evansherry  路  4Comments

lupajz picture lupajz  路  3Comments

maomaobug picture maomaobug  路  4Comments