Tag: 解释

解释这个Kotlin函数结构

我正在使用这个Kotlin函数。 我知道我们有一个名为mPasswordView!!.setOnEditorActionListener的函数,它mPasswordView!!.setOnEditorActionListener参数TextView.OnEditorActionListener ,但那是什么? 我们在参数里面有花括号吗? mPasswordView!!.setOnEditorActionListener(TextView.OnEditorActionListener { textView, id, keyEvent -> if (id == R.id.login || id == EditorInfo.IME_NULL) { attemptLogin() return@OnEditorActionListener true } false })