Closed thinwonton closed 8 years ago
我的layout为:
<android.support.design.widget.CoordinatorLayout android:id="@+id/rootLayout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout android:id="@+id/appbar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> <android.support.design.widget.TabLayout android:id="@+id/tabLayout" android:layout_width="match_parent" android:layout_height="wrap_content"/> </android.support.design.widget.AppBarLayout> <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
在viewpager中添加fragment fragment的layout是:
<?xml version="1.0" encoding="utf-8"?> <cn.bingoogolapple.refreshlayout.BGARefreshLayout android:id="@+id/rl_recyclerview_refresh" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView android:id="@+id/rv_recyclerview_data" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="none"/>
</cn.bingoogolapple.refreshlayout.BGARefreshLayout>
refresh布局不能正常显示,refresh view和load more view
补充: 实验了很久,造成上面的原因是,在fragment中,把BGARefreshLayout和recyclerview的初始化放在了onViewCreated,如果把初始化放在onCreateView就没问题 奇怪的现象
我的layout为:
<android.support.design.widget.CoordinatorLayout android:id="@+id/rootLayout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent">
</android.support.design.widget.CoordinatorLayout>
在viewpager中添加fragment fragment的layout是:
<?xml version="1.0" encoding="utf-8"?> <cn.bingoogolapple.refreshlayout.BGARefreshLayout android:id="@+id/rl_recyclerview_refresh" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">
</cn.bingoogolapple.refreshlayout.BGARefreshLayout>
refresh布局不能正常显示,refresh view和load more view