私は、スクロールビューでグリッドビューとリストビュー(ページ設定を含む)を持っています。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の最適化は、スクロール内にネストされていると機能しません。その中のすべてのビューが一度に描画されます。だからおそらくあなたはあなたの要件に基づいて1つ以上の列を持つ単一のGridviewを使用することを検討する必要があります。 –
ページネーションは正しく機能していますか?私が間違っていない場合は、スクロールビュー内に拡大可能な高さリストビューとグリッドビューが必要です。もし私が間違っているなら、親切に私を修正してください。 –