Skip to content

Instantly share code, notes, and snippets.

@groodt
Created March 17, 2013 15:17
Show Gist options
  • Save groodt/5181980 to your computer and use it in GitHub Desktop.
Save groodt/5181980 to your computer and use it in GitHub Desktop.
"Fix" SupportMapFragment issues Android 2.3.x
// Janky "fix" to prevent artefacts when embedding GoogleMaps in a sliding view.
// https://github.com/jfeinstein10/SlidingMenu/issues/168
// set background to transparent
private void setMapTransparent(ViewGroup group) {
int childCount = group.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = group.getChildAt(i);
if (child instanceof ViewGroup) {
setMapTransparent((ViewGroup) child);
} else if (child instanceof SurfaceView) {
child.setBackgroundColor(0x00000000);
}
}
}
// call it on the SupportMapFragment somewhere
setMapTransparent((ViewGroup) supportMapFragment.getView());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment