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

Section with dynamic rows #33

Closed
mitesh-shah opened this issue Nov 24, 2014 · 2 comments
Closed

Section with dynamic rows #33

mitesh-shah opened this issue Nov 24, 2014 · 2 comments

Comments

@mitesh-shah
Copy link

Hello, i am working on an app. I want to display the rows with dynamic size.
But, as your function
@OverRide
public int numberOfRows(int section)
{
34;
}

Which creates 35 rows in each section.
I want 2 rows in first section, 5 rows in second section.. like wise..
How can i achieve this?
Thanks in advance..!! :)

@dimitrireef
Copy link

found myself in same trouble, did you find a solution ?

@mitesh-shah
Copy link
Author

In my code, i just wanted 2 rows.
So i did following logic

        @Override
        public int numberOfSections() {
            return 2;
        }

        @Override
        public int numberOfRows(int section) {
            if (section == 0) {
                return installedList.size();
            } else {
                return availableList.size();
            }
        }

It will create rows based on the size of list specified.
installedList and availableList are ArrayList.
Hope this helps.!

@tokou tokou closed this as completed Jan 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants