Android MapView with Sliding Menu Obscures Menu

I have a map view for android api v2 maps in an activity that uses this sliding menu https://github.com/iPaulPro/SlidingMenu . A sliding menu works fine except for the map page. There is a black view covering the sliding menu, which is the exact size of the map. This is an example with a map height set to 100dp to indicate what I mean.

View Issue

If I touch this species, it will disappear. How can I get rid of it or make it transparent? I tried the requestTransparentRegion () trick. There are no dice.

+5
source share
3 answers

post ViewPager API Google v2: .

package com.myapp.gms.maps;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.FrameLayout;
import com.google.android.gms.maps.SupportMapFragment;

/**
 * @author btate
 */
public class TransparentSupportMapFragment extends SupportMapFragment {

    public TransparentSupportMapFragment() {}

    @Override
    public View onCreateView(LayoutInflater inflater, 
                                 ViewGroup view, 
                                 Bundle savedInstance) {

        View layout = super.onCreateView(inflater, view, savedInstance);
        FrameLayout frameLayout = new FrameLayout(getActivity());
        frameLayout.setBackgroundColor(
           getResources().getColor(android.R.color.transparent));
        ((ViewGroup) layout).addView(frameLayout,
            new ViewGroup.LayoutParams(
               LayoutParams.MATCH_PARENT, 
               LayoutParams.MATCH_PARENT
            )
        );
        return layout;
    }

}
+13

. MapFragment . MapFragment FrameLayout.

frameLayout.setVisibility(View.Visible) frameLayout.setVisibility(View.Gone) . . .

getSlidingMenu().setOnOpenListener(
    new OnOpenListener() {
        @Override
        public void onOpen() {
            frameLayout.setVisibility(View.GONE);
        }
    }
);

getSlidingMenu().setOnClosedListener(
    new OnClosedListener() {

        @Override
        public void onClosed() {
            frameLayout.setVisibility(View.VISIBLE);
        }
    }
);
0

TransparentSupportMapFragment Android 2.3.7 !

0

All Articles