listview horizontal in scrollview

4 posts, 0 answers
  1. Huong
    Huong avatar
    2 posts
    Member since:
    Jul 2015

    Posted 02 Jul 2015 Link to this post

    in telerik example with horizontal listview have 2 listview in scrollview I added 3 listview but I cannot scroll vertical by scrollview.are you fixe it?
  2. Antony Jekov
    Admin
    Antony Jekov avatar
    88 posts

    Posted 03 Jul 2015 Link to this post

    Hello Huong,

    Thank you for contacting the Android team.

    The ListView is simply a View as any other in the Android framework. Putting a third ListView inside a ScrollView should not be a problem.

    Could you please share the xml code you are using to put three list views inside a scroll view? Please include the code behind as well if you are modifying the layout in it. It will be really helpful for determining the reason for this issue.

    Thank you for your time and all best!

    Regards,
    Antony Jekov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Huong
    Huong avatar
    2 posts
    Member since:
    Jul 2015

    Posted 03 Jul 2015 in reply to Antony Jekov Link to this post

    Hi Antony JeKov

    here is my xml code.

     

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/gray"
    android:orientation="vertical"
    >
    <ScrollView
    android:id="@+id/scroll"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbars="vertical">

    <com.example.customview.CustomLinearLayout
    android:id="@+id/listViewsHolder"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
    android:id="@+id/txtDesserts"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:layout_marginLeft="@dimen/activity_horizontal_margin"
    android:layout_marginTop="16dp"
    android:text="@string/events"
    android:textColor="@color/white"
    android:textSize="12dp" />

    <com.telerik.widget.list.RadListView
    android:id="@+id/listViewEvents"
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:clipToPadding="false"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin">

    </com.telerik.widget.list.RadListView>

    <TextView
    android:id="@+id/txtPaleo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:layout_marginLeft="@dimen/activity_horizontal_margin"
    android:layout_marginTop="16dp"
    android:text="@string/food"
    android:textColor="@color/white"
    android:textSize="12dp" />

    <com.telerik.widget.list.RadListView
    android:id="@+id/listViewFoods"
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:layout_below="@id/listViewEvents"
    android:layout_marginBottom="16dp"
    android:clipToPadding="false"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:scrollbarStyle="outsideOverlay" />
    <TextView
    android:id="@+id/food"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:layout_marginLeft="@dimen/activity_horizontal_margin"
    android:layout_marginTop="16dp"
    android:text="@string/deal"
    android:textColor="@color/white"
    android:textSize="12dp" />

    <com.telerik.widget.list.RadListView
    android:id="@+id/listViewDeal"
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:layout_below="@id/listViewFoods"
    android:layout_marginBottom="16dp"
    android:clipToPadding="false"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:scrollbarStyle="outsideOverlay"/>
    <TextView
    android:id="@+id/test"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:layout_marginLeft="@dimen/activity_horizontal_margin"
    android:layout_marginTop="16dp"
    android:text="extra item"
    android:textColor="@color/white"
    android:textSize="12dp" />

    <com.telerik.widget.list.RadListView
    android:id="@+id/extraList"
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:layout_below="@id/listViewDeal"
    android:layout_marginBottom="16dp"
    android:clipToPadding="false"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:scrollbarStyle="outsideOverlay"/>


    </com.example.customview.CustomLinearLayout>
    </ScrollView>
    </LinearLayout>

  5. Todor
    Admin
    Todor avatar
    778 posts

    Posted 08 Jul 2015 Link to this post

    Hello Huong,

    It is not recommended to place a scrollable view inside another scrollable view. Here's one good answer on a similar question in Stack Overflow which is about RecyclerView but since RadListView extends it, the same concerns and suggestions are applicable.

    Regards,
    Todor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner