0

I have an activity that is a NestedScrollView, this scrollview contains a TableLayout.

The TableLayout's amount of content never changes, meaning it always has 15 TableRows.

However, I set some of the TableRows to be INVISIBLE, if there is no content for them currently.

The TableLayout is supposed to display currently connected Devices, and information about them.

If only 5 devices are connected only the first 5 TableRows will be visible and filled with content.

However, when the user goes to scroll it scrolls down past a lot of "white space" where the other 10 TableRows would be, but they are invisible.

Is there a way to tell the NestedScrollView to stop scrolling at the last visible view?

2 Answers 2

1

Try to set the rows to :

 View.GONE

not :

View.INVISIBLE
Sign up to request clarification or add additional context in comments.

Comments

0

Create the table programmatically. This way the rows will only exist when there is content and you won't have this problem.

Here is an example of how to do that: Create TableLayout programmatically

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.