I am developing a android app which uses DrawerLayout with SherlockMapFragment. Everything works fine with android 4.0+. But I wanna support 2.3+ (API level 10), so I am testing the app in a device with android 2.3.4 and here come my problems the layout become a mess with the map overlaying the menu. My code is below. Appreciate any help.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#2A2A2A"
android:choiceMode="singleChoice"
android:divider="@drawable/divider"
android:dividerHeight="1dp" />
</android.support.v4.widget.DrawerLayout>
MapFragment:
public class CustomMapFragment extends SherlockMapFragment implements
LocationListener {
public CustomMapFragment() {
}
private GoogleMap mMap;
private LocationManager locationManager;
private String provider;
private Geocoder geocoder;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
this.getSherlockActivity().getSupportActionBar().setTitle("myTitle");
View root = super.onCreateView(inflater, container, savedInstanceState);
mMap = getMap();
//another stuff
}
}
The result: