其他分享
首页 > 其他分享> > Android之RecyclerView.ItemDecoration

Android之RecyclerView.ItemDecoration

作者:互联网

ItemDecoration

RecyclerView的ItemDecoration在日常开发中使用还是很多的,但是一直没重视这一块,总是到用的时候就临时从网上看一下。虽然也能解决问题但是这种感觉不好,因此现在重点熟悉一下这一块。

public abstract static class ItemDecoration {
      public ItemDecoration() {
      }
      public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
            this.getItemOffsets(outRect, ((RecyclerView.LayoutParams)view.getLayoutParams()).getViewLayoutPosition(), parent);
      }
      public void onDraw(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
            this.onDraw(c, parent);
      }
      public void onDrawOver(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
            this.onDrawOver(c, parent);
      }
}


图中的图片分辨代表着

标签:NonNull,parent,getItemOffsets,ItemDecoration,Android,RecyclerView,public
来源: https://www.cnblogs.com/alasola/p/15845405.html