How to use data-binding in Dialog?

前端 未结 8 1767
傲寒
傲寒 2021-01-30 12:29

I am having trouble in implementing databinding in a Dialog. Is it possible?

Below is my xml.



    

        
8条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 13:10

    **

    You should use activity inside of context for DialogFragment.

    **

    The problem when you use databinding in DialogFragment is theme is not respect to dark mode colors. If you have problem with this use LayoutInflater.from(activity) inside of LayoutInflater.from(context)

提交回复
热议问题