【发布时间】:2019-11-29 13:16:00
【问题描述】:
我正在尝试将芯片添加到 ChipGroup(不是 singleLine):
val chip = Chip(this)
chip.isCloseIconVisible = true
for (i in 0..10) {
chip.setText("Some text $i")
chip_group.addView(chip as View)
}
但我得到一个例外:
The specified child already has a parent. You must call removeView() on the child's parent first.
如何将芯片标记为独特的孩子?或者我该怎么办?
【问题讨论】: