NullPointerException - Attempt to invoke virtual method RecyclerView$ViewHolder.shouldIgnore()' on a null object reference

后端 未结 6 1957
谎友^
谎友^ 2020-12-06 00:00

Several developers have reported seeing the following stack trace since upgrading to Android Support 23.2.0:

java.lang.NullPointerException: Attempt to invok         


        
6条回答
  •  囚心锁ツ
    2020-12-06 00:30

    If you absolutely need to modify layout params, you can use the default item layout params like this:

        ViewGroup.LayoutParams params = itemView.getLayoutParams();
        params.height=xx;
        params.width= xx;
        params.yyyy = xxx;
        itemView.setLayoutParams(params);
    

提交回复
热议问题