如何使用drawable为Anko editText添加边框。
这篇文章How to put a border in an EditText?解释了如何处理XML布局
在Anko DSL中,您对此代码片段添加了什么:
editText() {
hint = "Enter message"
lines = 4
maxLines = 4
singleLine = false
background="@drawable/file" // this is not right
}
答案 0 :(得分:1)
试试这个
editText(InputConstraints.PASSWORD) {
id = R.id.saEtPassword
hint = "Password"
inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
singleLine = true
padding = dip(10)
setBackgroundResource(R.drawable.edit_bg)
setHintTextColor(R.color.colorAccent)
}.lparams {
below(R.id.saEtEmail)
width = matchParent
height = wrapContent
}