Let’s simplify this question.
What I did:
- I created a custom Gridview
- I created an adapter view of the framelayout
What I am trying to accomplish is something similar to Shelve view.
Now the result was a proper view of how the background of the gridview looks like with the proper image. However every other image just is a bit off on the height and position. I just seem to get the width right.
What are the possible reasons for the cause of improperly placed images?
How would I set out the proper positioning of a gridview for the adapter?
From what I remember of your original version of your question you were drawing custom backgrounds for your grid items in your
GridViewthroughdispatchDraw. I think what you’re asking is why those backgrounds aren’t lining up with your actual child views created by your adapter. If so, I’d have to see some code/layout to be sure, but it’s likely that there’s padding/margin so that the child views are not laid out exactly evenly. I’m not sure why it’s every other image though.If you’re trying to create something like Shelves, you might just want to start by looking at the code there… It’s open source after all.