나는 scrollview에서 격자보기와 목록보기 (페이지 매김 포함)가 있습니다.Viewpager 프래그먼트에서 전체 화면을 스크롤 할 수있게 만드는 방법
결과적으로 개별 스크롤이 발생하지만 페이지별로 스크롤 할 수있는 전체 화면이 필요합니다. 나는 NestedListView & ExpandableHeightListView를 사용하려고했지만 제대로 작동하지 않습니다.
모든 제안은 감사 할 것입니다.
enter codXML::
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/swipeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:fillViewport="true"
android:paddingBottom="75dp">
<RelativeLayout
android:id="@+id/root_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="beforeDescendants"
android:focusable="true"
android:focusableInTouchMode="true">
<TextView
android:id="@+id/all_tpcs_heading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bg_horizantal_magzine_listview"
android:padding="@dimen/ten_dp"
android:text="all topics"
android:textAllCaps="true"
android:textSize="14sp" />
<com.healthyliving.live.utils.ExpandableHeightGridView
android:id="@+id/topicsGrid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/all_tpcs_heading"
android:layout_marginTop="@dimen/six_dp"
android:clipChildren="true"
android:gravity="center"
android:horizontalSpacing="@dimen/six_dp"
android:isScrollContainer="false"
android:numColumns="2"
android:stretchMode="none"
android:verticalSpacing="@dimen/six_dp" />
<TextView
android:id="@+id/rcnt_artcls_heading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/topicsGrid"
android:layout_marginTop="@dimen/six_dp"
android:paddingBottom="@dimen/ten_dp"
android:paddingLeft="@dimen/ten_dp"
android:paddingRight="@dimen/ten_dp"
android:paddingTop="@dimen/sixteen_dp"
android:text="Recent articles"
android:textAllCaps="true"
android:textSize="14sp" />
<ListView
android:id="@+id/recent_articles_listview"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/rcnt_artcls_heading"
android:dividerHeight="@dimen/list_view_divider" />
<ProgressBar
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:id="@+id/load_progreebar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateDrawable="@drawable/my_progress_indeterminate"
android:visibility="gone" />
</RelativeLayout>
</ScrollView>
조각 : 주어진 사용자 지정 목록 대신 레이아웃 XML 파일의 기본 ListView
및 GridView
의 격자보기 아래
recentArticleAdapter = new ExploreRecentArtilcesAdapter(getActivity(), featuredArticles);
mRecentArticles.setAdapter(recentArticleAdapter);
스크롤 내에 중첩되어 있으면 ListView 및 Gridview 최적화가 작동하지 않습니다. 그 안에있는 모든 견해가 즉시 그려집니다. 아마 당신은 당신의 요구 사항에 따라 하나 이상의 열이있는 단일 Gridview를 사용하는 것을 고려해야합니다. –
페이지 매김이 올바르게 작동합니까? 잘못된 것이 아니라면 스크롤 뷰 내부에서 확장 가능한 높이 목록 뷰와 격자보기가 필요합니다. 내가 틀렸다면 친절하게 정정하십시오. –