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
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.
Most helpful comment
That didn't work either.
But I found the solution.
Turns out adding the
org.jetbrains.anko:anko:$anko_versiondoesn't include the Snackbar.Added
org.jetbrains.anko:anko-design:$anko_versionand it is now working fine.