私はリサイクルビューを含むフラグメントを持っており、すべてのアイテムを押すと、すべてのスワイプでフラグメントを表示するビューページャを保持している別のフラグメントが表示されます。リサイクルビューアイテムを押した後に最初にフラグメントに入ると、ページャーは表示されません。 2回目は 、残りの時間は期待どおりのデータが表示されます。View Pagerは初めて初めての場合のみ
コード:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/lineItems"
style="@style/TitleTextView"/>
<android.support.v4.view.ViewPager
android:id="@+id/CardTablepager"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"/>
</LinearLayout>
コンテンツの断片(ビューページャは、このフラグメントをスワイプ)::ノー助けを借りて、いくつかの記事を読んで
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/poMainlayout">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/CardViewStyle"
android:layout_margin="8dp"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/poLineItemsTable"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbarStyle="outsideInset"
/>
</android.support.v7.widget.CardView>
</LinearLayout>
:Android Viewpager display wrong data on first load
主なフラグメントは、ビューページャ保持しています
また、メインのfragmeからアダプターを無効にしようとしましたヘルプなしのNT:
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
viewPager.getAdapter().notifyDataSetChanged();
}
どのようなアイデアですか?
あなたが入れて持っていけません'Recyclerview'は' ScrollView'の中に 'ScrollingView'と' NestedScrollingChild'を実装しています – eLemEnt
私は質問を更新したので、問題ではなく水平と垂直のスクロールでリサイクルビューを作成したいと考えました。 – BoazGarty