1

我为我的应用程序使用 SlidingMenu 库和 Google Play 服务。

现在,当我在地图上打开 Slidemenu 时,Slidemenu UI 是黑色的。

问题显示在这里: http://i.stack.imgur.com/j3XCN.jpg

xml代码:

<fragment
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.SupportMapFragment"
/>

活动 :

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    Create_SliderMenu();

    map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

    LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    final LatLng KIEL = new LatLng(53.551, 9.993);

    LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); 
    Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);



    Position_mark=new LatLng(53.558,9.927);
    //Position_mark=new LatLng(latitude, longitude);

    Marker hamburg=map.addMarker(new MarkerOptions().position(Position_mark).title("Hamburg"));

    Marker Kiel=map.addMarker(new MarkerOptions().position(KIEL).title("Kiel").snippet("Kiel is cool").icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_launcher)));

    map.moveCamera(CameraUpdateFactory.newLatLngZoom(Position_mark, 15));

    map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);


    markerLatLng = new LatLng(48.8567,2.3508);

}

private void Create_SliderMenu() {
    ActionBar ab = getSupportActionBar();
    ab.setHomeButtonEnabled(true);
    ab.setDisplayHomeAsUpEnabled(true);
    //ab.set
    menu = new SlidingMenu(this);
    menu.setMode(SlidingMenu.LEFT_RIGHT);
    menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
    menu.setShadowWidthRes(R.dimen.shadow_width);
    menu.setShadowDrawable(R.drawable.shadow);
    menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
    menu.setFadeDegree(0.35f);
    menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
    // menu.attachToActivity(getApplicationContext(),  SlidingMenu.SLIDING_CONTENT, 1);
    //menu.attachToActivity(MainActivity.this, SlidingMenu.SCROLLBAR_POSITION_LEFT, actionbarOverlay)
    menu.setMenu(R.layout.menu);
    //menu.setBehindWidth(20);
    menu.setSecondaryMenu(R.layout.activity_rightmenu);
}   

我已经更新了代码

我该如何解决这个问题?

4

0 回答 0