当前位置:网站首页>Recyclerview control list item layout match_ Fundamental principle of parent attribute invalidation

Recyclerview control list item layout match_ Fundamental principle of parent attribute invalidation

2022-04-23 18:43:00 KIDD-4869

Principle jump
Although this is a problem that novices will encounter , But after doing it for a while, I forgot ... Still, , Decide to write down , In addition, it is better to use the following format , You don't have to pass context 了 .

	override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
    
        val binding = ItemF9TtclLayoutBinding.bind(LayoutInflater.from(parent.context).inflate(R.layout.item_f9_ttcl_layout, parent, false))
        return ViewHolder(binding)
    }

Make a note of .

版权声明
本文为[KIDD-4869]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210603464352.html