当我尝试自定义隐藏密码Kotlin时需要帮助

时间:2018-07-26 19:02:23

标签: android-studio kotlin

我希望用户输入“ A”作为示例,然后看到“ b”,我希望以其他方式使用该应用的自定义键盘

这是我今天尝试过但没有奏效的

import android.text.method.PasswordTransformationMethod
import android.view.View

class passit: PasswordTransformationMethod() {
    override fun getTransformation(source: CharSequence?, view: View?): CharSequence {
return turnit(source!!)   }
    class turnit(val s:CharSequence):CharSequence{
        override val length: Int=  s.length

        override fun get(index: Int): Char {
return 'f'      }

        override fun subSequence(startIndex: Int, endIndex: Int): CharSequence {
            return s.subSequence(0,s.length)      }


    }
}

mian给出错误:类型的transformationMethod无法作为函数调用

Petitionadd.transformationMethod(passit())

1 个答案:

答案 0 :(得分:0)

您要在get-wmiobject -namespace Root\MicrosoftBizTalkServer -query "SELECT * FROM MSBTS_ServiceInstance WHERE (ServiceClass = 1 OR ServiceClass = 64) AND AssemblyName LIKE 'Our.AssemblyName'" 上调用的函数是get-wmiobject : An internal failure occurred for unknown reasons. At line:1 char:1 + get-wmiobject -namespace Root\MicrosoftBizTalkServer -query "SELECT * ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

TextView

您还可以将Kotlin作为属性访问:

setTransformationMethod