Skip to content

Commit d579f00

Browse files
committed
fix the bug that refreshlayout shows in the center of screen.
1 parent 6bd29f2 commit d579f00

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

README_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ startAnim则是在onRefresh/onLoadMore之后才会回调的过程(此处是显
295295

296296
#### v1.05
297297
- 修复触摸监听失效问题
298+
- TODO 修复wrap_content时刷新控件显示在屏幕中央问题
298299

299300
#### v1.04
300301
##### 新增功能

app/src/main/res/layout/test.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="wrap_content" android:layout_height="wrap_content">
4+
<FrameLayout
5+
android:layout_width="match_parent"
6+
android:layout_height="30dp"
7+
android:background="#fae"
8+
android:layout_alignParentTop="true"
9+
android:layout_centerHorizontal="true"
10+
android:foregroundGravity="top"
11+
android:id="@+id/frameLayout" />
12+
13+
<android.support.v7.widget.RecyclerView
14+
android:id="@+id/recyclerview"
15+
android:layout_width="match_parent"
16+
android:layout_height="match_parent"
17+
android:overScrollMode="never"/>
18+
</com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout>

library/src/main/java/com/lcodecore/tkrefreshlayout/TwinklingRefreshLayout.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ private void addHeader() {
127127
FrameLayout headViewLayout = new FrameLayout(getContext());
128128
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, 0);
129129
layoutParams.addRule(ALIGN_PARENT_TOP);
130-
layoutParams.addRule(CENTER_VERTICAL);
131130

132131
FrameLayout extraHeadLayout = new FrameLayout(getContext());
133132
extraHeadLayout.setId(R.id.ex_header);
@@ -146,7 +145,6 @@ private void addFooter() {
146145
FrameLayout bottomViewLayout = new FrameLayout(getContext());
147146
LayoutParams layoutParams2 = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);
148147
layoutParams2.addRule(ALIGN_PARENT_BOTTOM);
149-
layoutParams2.addRule(CENTER_VERTICAL);
150148
bottomViewLayout.setLayoutParams(layoutParams2);
151149

152150
mBottomLayout = bottomViewLayout;

0 commit comments

Comments
 (0)