Issue
I am trying to add many RecyclerView
s dynamically to a LinearLayout
depending upon the x coordinate of a 2-D array (Set). All the children of each view are not visible (it appears on scrolling the view).
In short, making the RecyclerView's height to WRAP_CONTENT
is not stretching the height of RecyclerView
.
I want all the children of all the RecyclerViews to be visible and not let any RecyclerView
to be scrollable.
Following is the table_layout
which I add dynamically:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Engine"
android:padding="6dp"
android:gravity="center"
android:id="@+id/tv_label"
android:layout_marginTop="16dp"
android:background="@color/light_gray"
android:textSize="@dimen/bid_report_label_text_size"
android:textColor="@color/white"
android:textStyle="bold"/>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/recycler_view"/>
</LinearLayout>
Following is the activity_main
layout of activity:
<RelativeLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/button_bid_now"
android:id="@+id/scrollView">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/linear_layout_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="210dp"
android:id="@+id/bike_image"
android:onClick="startImageSlideshow"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linear_layout_details"
android:orientation="vertical"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
I add table_layout
to activity_main
dynamically.
Please tell me how to make the RecyclerView
WRAP_CONTENT
?
Solution
The problem was with ScrollView
. Changing it to NestedScrollView
solved the problem.
Answered By - backslashN
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.