I’m writing an Android app to keep up with shopping lists. The main view has a list of all existing lists and tapping an item will open the details view that has a button for adding items to the list. The items are on a list and the add button is on the ListView footer.
When I create a new list the add item button is not showing but when I return to the details view the button is there. I added the screenshots at the end to clarify the problem. I’ve tested this with an actual device as well.
The layout XML has RelativeLayout with two child LinearLayouts, one for the static header and one for the ListView. Could this cause issues? The code is working but how can it work only after the initial save?
First of all, don’t wrap ListView ( or any SIGNLE view for that matter ) in the LinearLayouts without having a good reason to do that. Nothing gonna break, it just looks bad ..
From what i see – you can build THAT UI by placing all views inside single RelativeLayouts.
For the add button, i wouldn’t make it as footer – i’d just would add this at the bottom
ListTitleLabel
ListTitle ( below label)
SaveButton (below title )
AddButton ( align parent bottom)
ListView ( above the Add, below Save )
Something like that..