diff --git a/LRecyclerview_library/src/main/java/com/github/jdsjlzx/recyclerview/LRecyclerView.java b/LRecyclerview_library/src/main/java/com/github/jdsjlzx/recyclerview/LRecyclerView.java index c4ddc62..9137b07 100644 --- a/LRecyclerview_library/src/main/java/com/github/jdsjlzx/recyclerview/LRecyclerView.java +++ b/LRecyclerview_library/src/main/java/com/github/jdsjlzx/recyclerview/LRecyclerView.java @@ -369,6 +369,14 @@ public void setLoadMoreFooter(ILoadMoreFooter loadMoreFooter) { this.mLoadMoreFooter = loadMoreFooter; mFootView = loadMoreFooter.getFootView(); mFootView.setVisibility(GONE); + + //wxm:mFootView inflate的时候没有以RecyclerView为parent,所以要设置LayoutParams + ViewGroup.LayoutParams vlp = mFootView.getLayoutParams(); + if (vlp != null) { + mFootView.setLayoutParams(new LayoutParams(vlp)); + } else { + mFootView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); + } } public void setPullRefreshEnabled(boolean enabled) {