diff --git a/app/src/main/java/io/legado/app/ui/widget/LabelsBar.kt b/app/src/main/java/io/legado/app/ui/widget/LabelsBar.kt index 22f982cf6..6c415fcbd 100644 --- a/app/src/main/java/io/legado/app/ui/widget/LabelsBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/LabelsBar.kt @@ -21,7 +21,7 @@ class LabelsBar(context: Context, attrs: AttributeSet?) : LinearLayout(context, } fun setLabels(labels: List) { - removeAllViews() + clear() labels.forEach { addLabel(it) } @@ -53,5 +53,4 @@ class LabelsBar(context: Context, attrs: AttributeSet?) : LinearLayout(context, tv.text = label addView(tv) } - } \ No newline at end of file