Skip to content

isn't there a way to make it scrollable horizontally? #14

Closed

Description

@mohammadrafigh

thanks for your great library,

I have a problem. in my situation I have tables with 10-50 columns, I really need to have a horizontal scroll for it and also making more width for each column. is there anyway to do that?

Activity

  1. self-assigned this
    on Feb 20, 2016
  2. ISchwarz23 commented on Feb 20, 2016

    @ISchwarz23
    Owner

    Hi mohammadrafigh,

    I think you can achive this by simple putting the TableView inside a HorziontalScrollView.
    Have a look at this sampe layout:

    ...
    
        <android.widget.HorizontalScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
    
            <de.codecrafters.tableviewexample.SortableCarTableView
                android:id="@+id/tableView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                custom:headerElevation="10"
                custom:headerColor="@color/primary"
                custom:columnCount="4" />
    
        </android.widget.HorizontalScrollView>
    
    ...
    
  3. mohammadrafigh commented on Feb 20, 2016

    @mohammadrafigh
    Author

    thanks for your response, ah thanks! I tried it with ScrollView and default HorizontalScrollView but they didn't work. it's weird that with android.widget.HorizontalScrollView it works 👍

    I'm trying to use it for RTL languages so if you want I may be able to add this feature to your library too.

  4. ISchwarz23 commented on Feb 21, 2016

    @ISchwarz23
    Owner

    Please open a new issue for the RTL support if you want to have it ;)

  5. chemoral87 commented on Jul 13, 2016

    @chemoral87

    It works for me, I defined the layout_width.

    <HorizontalScrollView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
    
    
                    <de.codecrafters.tableviewexample.SortableCarTableView
                        android:id="@+id/tableView"
                        android:layout_below="@id/toolbar"
                        android:layout_width="900dp"
                        android:layout_height="match_parent"
                        custom:tableView_columnCount="5"
                        custom:tableView_headerColor="@color/primary"
                        custom:tableView_headerElevation="10"/>
    
    
            </HorizontalScrollView>
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions