Last active
September 1, 2021 17:40
-
-
Save kamikat/2ba5f741f807d56a8dd7cf936571e69e to your computer and use it in GitHub Desktop.
NestedScrollView + SwipeRefreshLayout + RecyclerView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.v4.widget.SwipeRefreshLayout | |
android:id="@+id/refreshLayout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.v4.widget.NestedScrollView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="vertical" | |
android:focusableInTouchMode="true"> <!-- Prevents scrolling location from being overriden by RecyclerView --> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="200dp" | |
android:gravity="center" | |
android:text="Contents above RV"/> | |
<android.support.v7.widget.RecyclerView | |
android:id="@+id/recyclerView" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
</android.support.v7.widget.RecyclerView> | |
</LinearLayout> | |
</android.support.v4.widget.NestedScrollView> | |
</android.support.v4.widget.SwipeRefreshLayout> |
i have horizontal and vertical scroll view and got many issues:
<androidx.core.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rcStory"
android:layout_width="match_parent"
android:layout_height="100dp"
android:nestedScrollingEnabled="false"
android:background="@color/red" />
<com.jcodecraeer.xrecyclerview.XRecyclerView
android:id="@+id/rcRecent"
android:layout_width="match_parent"
android:descendantFocusability="blocksDescendants"
android:layout_weight="1"
android:nestedScrollingEnabled="false"
android:layout_height="match_parent"
android:background="@color/mainGray" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i think recyclerview
height
must bematch_parent