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条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!