有两种方法,简单的一种:在viewModel中通过传入的view获得context来实现: class MainActivityVM {。。。fun onClick(view: View) { val context = view.context val ...
確定! 回上一頁