DataBinding에서 BindingAdapter 사용 #25
choius323
started this conversation in
Show and tell
Replies: 1 comment
-
바인딩 어댑터 사용시 xml에서 chat list와 map key의 관계가 잘 보이지 않는 것 같습니다. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
비슷한 기능을 하는데 어떤 게 더 나을까요?
이렇게 뷰마다 각각 데이터를 불러와서 직접 넣어주는 방식이 있습니다.
BindingAdapter가 따로 필요 없지만, xml에서 코드가 길어지고 보기 어렵습니다.
뷰에서 데이터를 넣어주면 함수에서 처리해주는 방식이 있습니다.
xml이 깔끔하지만, 파라미터 2개가 필요하고 함수가 길어지는 단점이 있습니다.(enum class 사용하면 조금 줄어들 수 있습니다.)
지금은 키워드, 지역만 있고 더 추가될 내용이 있을지 떠오르는 건 없네요.
Beta Was this translation helpful? Give feedback.
All reactions