Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mohammadrafigh opened this issue Feb 19, 2016 · 4 comments
Closed

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

mohammadrafigh opened this issue Feb 19, 2016 · 4 comments
Assignees

Comments

@mohammadrafigh
Copy link

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?

@ISchwarz23 ISchwarz23 self-assigned this Feb 20, 2016
@ISchwarz23
Copy link
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>

...

@mohammadrafigh
Copy link
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.

@ISchwarz23
Copy link
Owner

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

@chemoral87
Copy link

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
Projects
None yet
Development

No branches or pull requests

3 participants