Closed XiaoRanLiu3119 closed 1 year ago
建议你fork本仓库在sample中复现该问题, 否则会让我陷入猜测中浪费很多精力. 会导致我无法完成更多的bug和开源项目新需求
我修改demo中的RefreshFragment
布局文件后正常显示, 无法复现你描述的问题
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:text="一旦刷新数据成功后下拉刷新不会再会显示错误页面"
android:textColor="@color/textSecond"
android:textSize="12dp" />
<com.drake.brv.PageRefreshLayout
android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.drake.brv.PageRefreshLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:text="底部" />
</LinearLayout>
我修改demo中的
RefreshFragment
布局文件后正常显示, 无法复现你描述的问题<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="50dp" android:gravity="center_vertical" android:paddingLeft="16dp" android:text="一旦刷新数据成功后下拉刷新不会再会显示错误页面" android:textColor="@color/textSecond" android:textSize="12dp" /> <com.drake.brv.PageRefreshLayout android:id="@+id/page" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/rv" android:layout_width="match_parent" android:layout_height="match_parent" /> </com.drake.brv.PageRefreshLayout> <TextView android:layout_width="match_parent" android:layout_height="50dp" android:gravity="center" android:text="底部" /> </LinearLayout>
我下了demo也修改了确实没问题,不过我将demo的布局复制过来还是会出现,目前未找到原因,我再找找看 `<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:text="一旦刷新数据成功后下拉刷新不会再会显示错误页面"
android:textSize="12dp" />
<com.drake.brv.PageRefreshLayout
android:id="@+id/page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.drake.brv.PageRefreshLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="底部布局"/>
</LinearLayout>
`
你得考虑fragment外层是什么布局
我擦,蠢哭了,感谢指点,用了竖向的viewpager2,结果高度是wrap_content,就盯着这页看了
问题描述
使用缺省页的时候,父布局是线性布局,PageRefreshLayout的顶部与底部分别有个固定的view,此时为PageRefreshLayout设置layout_weight = 1 时,缺省页会变小,不会铺满
期望行为
线性布局下分配权重正常显示,目前改用相对布局解决的,如果是我使用问题或无必要修改可以close
如何复现
代码 `<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" tools:context=".ui.hotel.fragment.NotUploadFragment" android:orientation="vertical">
`
截图
erro loading 正常显示
异常堆栈信息或者手机截图/视频(拖拽到输入框即可上传)
版本