Databinding을 이용해 xml 파일에서 뷰의 visibility 속성을 지정하려는 이리저리 바꿔보아도 빨간 줄이 사라지지 않습니다..
무시하고 그냥 빌드를 했더니 이런 오류 문구가 뜨더군요.
Could not find identifier 'View'.
Check that the identifier is spelled correctly, and that no <import> or <variable> tags are missing.
원인은 <data></data> 태그에 View가 import 되어 있지 않은 이유였습니다.
해결방법
<data>
<import type="android.view.View"/>
...
</data>
...
<com.rey.material.widget.FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="@{!viewmodel.thumbnail.empty ? View.VISIBLE : View.GONE}">
728x90
반응형
'Android' 카테고리의 다른 글
[안드로이드] 커스텀 다이어로그(Custom Dialog) 모서리 흰 배경이 보이는 현상 해결방법, 좌우 여백 조절 방법 (1) | 2023.07.28 |
---|---|
[안드로이드] 이미지(ImageView) 테두리의 모서리 둥글게 만들기 (0) | 2023.07.21 |
[안드로이드] Hilt에서 @Binds와 @Provides의 차이 (0) | 2023.07.15 |
[안드로이드] 벡터파일(.svg)을 ImageView에 로드하는 방법 feat. Coil (0) | 2023.07.12 |
[안드로이드] Lottie 애니메이션 사용하기 (0) | 2023.06.08 |