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不能滚动了.
请教各位大牛了.