반응형
<View
android:id="@+id/overDueTodoLine"
android:layout_width="match_parent"
android:layout_height="@dimen/line_size"
android:layout_marginBottom="20dp"
android:background="#DAE4E4E2"
android:tag="4" />
- view는 id 외에 tag로도 접근 가능합니다.
val targetView = (this as ViewGroup).findViewWithTag<View>(number.toString())
targetView?.visibility = View.GONE
- XML이 아닌 코드에서 수정
targetView.tag = "001"
반응형