📜  Snackbar android 示例 Kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:31.875000             🧑  作者: Mango

代码示例1
fun onSNACK(view: View){
    //Snackbar(view)
    val snackbar = Snackbar.make(view, "Replace with your own action",
            Snackbar.LENGTH_LONG).setAction("Action", null)
    snackbar.setActionTextColor(Color.BLUE)
    val snackbarView = snackbar.view
    snackbarView.setBackgroundColor(Color.LTGRAY)
    val textView =
            snackbarView.findViewById(com.google.android.material.R.id.snackbar_text) as TextView
    textView.setTextColor(Color.BLUE)
    textView.textSize = 28f
    snackbar.show()
}