Skip to content

Instantly share code, notes, and snippets.

@lilac
Last active September 29, 2015 23:44
Show Gist options
  • Save lilac/ea54468e148c434a167e to your computer and use it in GitHub Desktop.
Save lilac/ea54468e148c434a167e to your computer and use it in GitHub Desktop.
Margins trap in android
GridLayoutManager does not respect children's layout parameters. It sends measure spec as `EXACTLY` to children's `onMeasure` method.
You could wrap each children in a layout like FrameLayout.
ViewPager does not respect its children's margin settings. To have margins, wrap your children in a FrameLayout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment