adsafsa 2016-08-07 03:21 采纳率: 100%
浏览 1041
已采纳

PullToRefreshScrollView嵌套PullToRefreshGridView

PullToRefreshScrollView嵌套PullToRefreshGridView的情况下:
如何实现PullToRefreshScrollView有下拉功能,PullToRefreshGridView有上拉加载功能?
它们不嵌套,很好搞定,但是嵌套了怎么实现上面的功能呢?

代码如下:
android:id="@+id/content_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fadingEdge="none">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

android:text="Hello World!"
android:layout_weight="match_parent"
android:layout_height="wrap_content" />

android:text="Hello World!"
android:layout_weight="match_parent"
android:layout_height="wrap_content" />

xmlns:ptr="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/home_grid"
android:numColumns="2"
android:verticalSpacing="1dp"
android:horizontalSpacing="1dp"
android:columnWidth="100dp"
android:stretchMode="columnWidth"
ptr:ptrMode="pullFromEnd">

我试过了PullToRefreshGridView重写

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(
Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
结果PullToRefreshScrollView嵌套的PullToRefreshGridView不能滚动了.

请教各位大牛了.

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作