Android Maps api v2 strange phenomenon

My application has integrated a map fragment (Android Maps Api V2) and it works great as shown in this picture:

enter image description here

but when a soft key mark is displayed, the map shifts up and becomes blank, as shown in the following figure:

enter image description here

I must also say that this phenomenon extends to galaxy S (2.3.3) not galaxy SIII and not even galaxy Y, is this a performance issue or bug or am I missing anything?

Please help if you ever faced this problem ..

Thank.

+3


source to share


1 answer


You can try this:

public class MyMapFragment extends SupportMapFragment() {
 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = super.onCreateView(inflater, container, savedInstanceState);
  setMapTransparent((ViewGroup) view);
  return view;
 };

 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);
   }
  }
 }
 // ...
};

      



Instead of using the mapFragment provided by Google, use this one. For me this problem was fixed, but it was doing it in a sliding menu.

Credits to: https://github.com/jfeinstein10/SlidingMenu/issues/168#issuecomment-11834105

0


source







All Articles