-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
layout_height="wrap_content"和emptyview 两个需求 #8
Comments
我看了你说的“二手车之家”app。 |
先这样用吧 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这项目很不错,但我想要更好
#1. layout_height
com.canyinghao.canrefresh.CanRefreshLayout
的android:layout_height
以及<android.support.v7.widget.RecyclerView android:id="@id/can_content_view" android:layout_width="match_parent" android:layout_height="match_parent"
的android:layout_height
试过只能设置为
android:layout_height="match_parent",
能不能支持设置为wrap_content
;意思是CanRefreshLayout和RecyclerView的高度随着RecyclerView的item数量变化,
比如RecyclerView的item数量是2个,CanRefreshLayout就是2个item高度,下边不会有空白;RecyclerView item数量是1个,CanRefreshLayout就是1个item高度,下边不会有空白;RecyclerView item数量是200个,CanRefreshLayout就是默认的最大高度,比如半屏。
#2. emptyview
比如我的emptyview 一个无网络,一个无搜索结果, 无搜索结果,同时也要支持下拉刷新,就不能和RecyclerView放同一个CanRefreshLayout下边,emptyview也不放在RecyclerView里边
emptyview里有一个imageview,一个texitview和一个button,比如
<RelativeLayout android:id="@+id/noNetwork" <ImageView .../> <TextView 网络不给力.../> <Button 点击重试.../>
;现在我是放2个CanRefreshLayout,一个CanRefreshLayout下边是RecyclerView,一个CanRefreshLayout是无结果无网络的emptyview,能不能支持把emptyview和RecyclerView放一起;我有个项目同一个activity多子页面用了好多个CanRefreshLayout感觉太土了。
以上有app参考,汽车之家的“二手车之家”app(che168.com), 安装运行后在首页(底部是首页、买车、卖车、工具、我的),点‘买车’,
在买车页右上角点地图那个图标,然后地图上随便点1-3个车源的点,出来的列表高度是可变的,最大高度半屏,同时支持下拉刷新,无网络页面。
The text was updated successfully, but these errors were encountered: