【问题标题】:type mismatch required:Editabel Found:String需要类型不匹配:可编辑找到:字符串
【发布时间】:2018-12-13 01:16:48
【问题描述】:

我是编程新手,如果有任何帮助,我们将不胜感激

buFindAge.setOnClickListener {
val YearOfBirth:Int=txtYearOfBirth.toString().toInt()
val myAge:Int=2018-YearOfBirth
 tvShowAge.text=myAge.toString()
 tvShowAge.text="$myAge"  // Same error
    }

【问题讨论】:

标签: android android-studio kotlin


【解决方案1】:

使用.setText() 而不是text=

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-10-13
  • 2014-09-26
  • 2019-04-30
  • 2019-08-22
相关资源
最近更新 更多