Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i am developing an application where i need to create horizontal scrollable buttons.Actually what i am trying to do is,i have an array of some dates and i want that every dates should be in form of buttons and if user clicks that button it should open a list view of the data relevant to that date.i don't have any idea how to achieve this functionality,so any help will be cordially appreciated,thanks in advance.
Posted

1 solution

Straight to code !
Use the XML given below in your layout and it will start scrolling horizontally.

Note: You cannot have both horizontal and vertical scrolls using the built-in framework.


<scrollview xmlns:android="http://schemas.android.com/apk/res/android">
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:scrollbars="vertical">

    <horizontalscrollview xmlns:android="http://schemas.android.com/apk/res/android">
        android:layout_width="320px" android:layout_height="fill_parent">


        <tablelayout xmlns:android="http://schemas.android.com/apk/res/android">
            android:id="@+id/linlay" android:layout_width="320px"
            android:layout_height="fill_parent" android:stretchColumns="1"
            android:background="#000000"/>

    </tablelayout></horizontalscrollview>

</scrollview>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900