【问题标题】:Android Kotlin Anko Alert CustomView ErrorsAndroid Kotlin Anko 警报 CustomView 错误
【发布时间】:2019-09-04 04:31:49
【问题描述】:

似乎找不到任何有关如何使用自定义视图正确创建警报的资源,该自定义视图具有编辑文本并在单击的正按钮上执行操作。

fun ForgotPassword() {
    alert {
        title = R.string.signin_reset_password.toString()
        customView { verticalLayout{
            val input = editText {
                hint = "Enter your email"
            }
            positiveButton(R.string.sign_in_reset) {
                mAuth.sendPasswordResetEmail(input.text.toString())
                    .addOnSuccessListener {
                        toast("Reset email has been sent.").show()
                    }
                    .addOnFailureListener{
                        toast("Reset email was not sent. Try again.").show()
                    }
            }
        } }

    }
}

错误 1:

D:\Android\Keep\keep-android\app\src\main\java\com\irondigitalmedia\keep\SignIn.kt: (63, 29): Overload resolution ambiguity:
public inline fun ViewManager.editText(init: (@AnkoViewDslMarker EditText).() -> Unit): EditText defined in org.jetbrains.anko
public inline fun ViewManager.editText(init: (@AnkoViewDslMarker EditText).() -> Unit): EditText defined in org.jetbrains.anko

错误 2:

D:\Android\Keep\keep-android\app\src\main\java\com\irondigitalmedia\keep\SignIn.kt: (64, 21): Unresolved reference: hint

【问题讨论】:

    标签: android kotlin alert custom-view anko


    【解决方案1】:

    我怀疑这与“错误 1”中的模棱两可的签名相同这一事实有关。

    在你的依赖项中有两个版本的 Anko 吗?

    我怀疑“错误 1”解决后“错误 2”会消失。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多