数据不可见

Data not visible

  1. 我的变量Class
data class QnaVariable( val questionOne: String, val answerOne : String,  val questionTwo: String, val answerTwo : String)
  1. 我的视图模型Class
    val item = QnaVariable("I am unable to login my account",
        "You can reset password using the Reset Password in My account Page. If you are still unable to access your account, then please call our customer care.",
        "Still need help?",
        "Have a queries? please get in touch and we will be happy to help you")

}
  1. 我的片段Class
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        binding = FragmentQuestionAnswerBinding.inflate(layoutInflater, container, false)

        val model = viewModel.item

        //binding.questionHeading1.text = model.toString()
        binding.questionHeading1.text = QNAdapter(myList).toString()

        return binding.root
    }
}
return FragmentQuestionAnswerBinding.inflate(layoutInflater, container, false).apply { 
    binding = this
    //TODO: write code to update your ui
}.root

像这样修改绑定部分。