我将SlidingMenu Library和Google Play Service用于我的应用程序。
现在,当我在地图上打开Slidemenu时,Slidemenu UI是黑色的。
此处显示的问题是:
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);
}
我已更新代码
我该如何解决这个问题?