Skip to content
Advertisement

Android Constraint Layout in Scroll View not showing the last item

I’m trying to make a fragment that have a sort of form with lots of textViews, EditTexts and spinners, so i have to use a scrollView to see all the items.

For some reason the last item is not showing and i don’t understand why, I read lots of questions about this problem but no one works for me.

Can someone help me to solve this problem?

The xml:

JavaScript

The last item (the button) are not showing when i use the app, i scroll and see all the items, except the button.

UPDATE using a useless item after the button with 60dp of weight allows me to scroll and see the button, i don’t like it but seems to be the only solution

UPDATE 2 I put the full xml

Advertisement

Answer

Have you tried making a dummy item ? In other words, add something that is fully transparent (invisible) but will take physical space after the button ? For example, a normal TextView with such parameters:

JavaScript

Also, one thing to keep wary of, for best practices: When you’re setting constraints, for example here

JavaScript

You don’t use @+id/assignmentSpinner but rather @id/assignmentSpinner (Remove the plus sign)

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement