android - Horizontal RecycleView doesn't display its full content -


i have listview , inside want horizontal recyclerview custom items. problem somehow textview under each image isn't displayed.

enter image description here

main listview item recyclerview

<?xml version="1.0" encoding="utf-8"?> <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:id="@+id/category_title"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="start"         android:textsize="20sp"         android:layout_marginright="10dp"/>      <android.support.v7.widget.recyclerview         android:id="@+id/horizontal_recycler_view"         android:scrollbars="vertical"         android:layout_width="match_parent"         android:layout_height="110dp" /> </linearlayout> 

single item of recyclerview

<linearlayout     android:layout_width="100dp"     android:layout_height="wrap_content"     android:orientation="vertical"     xmlns:android="http://schemas.android.com/apk/res/android" >      <imageview android:id="@+id/horizontal_list_image"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center_horizontal" />      <textview android:id="@+id/horizontal_list_text"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center_horizontal"         android:text="ffffffff"         android:textsize="15sp"/> </linearlayout> 

this should work.

    <linearlayout     android:weightsum="2"      android:layout_width="100dp"     android:layout_height="wrap_content"     android:orientation="vertical"     xmlns:android="http://schemas.android.com/apk/res/android" >      <imageview          android:layout_weight="1"          android:id="@+id/horizontal_list_image"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center_horizontal" />      <textview         android:layout_weight="1"           android:id="@+id/horizontal_list_text"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center_horizontal"         android:text="ffffffff"         android:textsize="15sp"/> </linearlayout> 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -