How to make the background of a Gridview scroll
I need to design some kind of book-shelf-looking view for an Android app I'm developing. First thing I thought to use was a gridview where each item would be a book in the shelf. I already hav开发者_JAVA百科e the art done and after doing the server side connection I end up with a nice looking book shelf filled with books.
But as soon as I get more books than the screen can fit, the GridView allows me to scroll down to see more books, which is the behaviour that I expect. What I didn't expect was the background image to stay in one place while the gridview containing the books slides up.
So this is a broad question, is there any way to accomplish what I want with a Gridview? Or should I better start looking for other alternatives?
This sample application written by an Android engineer includes a class that extends GridView to create a bookshelf that scrolls correctly: http://code.google.com/p/shelves/
Or more specifically: http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/view/ShelvesView.java
Put your GridView inside of ScrollView
精彩评论