有感而发,希望各位大佬多批评指点,今天就要离职了,翻出了一年前刚入职写的代码,就当是一段回忆吧。
binding.yourText.text = "aaaaaaaaaaaaaaaaaaaaaaa"
val text = binding.yourText.text
val newText = text.toString() + "X"
binding.yourText.text = newText
val end = newText.length
val imageSpan = ImageSpan(this, R.mipmap.ic_wallet_copy_address)
val setData = SpannableStringBuilder(binding.yourText.text)
setData.setSpan(imageSpan, end - 1, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
binding.yourText.text = setData
新人报道,请多关照,加油,朋友们