0

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?

sdfwer
  • 1,042
  • 3
  • 10
  • 23
  • Your original question was certainly a bit confusing and hard to understand what was exactly wrong, but now that you've removed all detail, it's quite vague and near impossible to ascertain exactly what is wrong in your situation. You still need to provide relevant details for anyone to have a chance of helping you. – kabuko May 07 '12 at 17:21
  • Thank you. I updated it, could you take a look at it if it makes more sense. – sdfwer May 07 '12 at 17:29

1 Answers1

1

From what I remember of your original version of your question you were drawing custom backgrounds for your grid items in your GridView through dispatchDraw. 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.

kabuko
  • 36,028
  • 10
  • 80
  • 93