1

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:Layout Problem

4

1 回答 1

0

几周前我解决了这个问题。这是谷歌地图上的一个已知问题。如果你有同样的问题,看看下面的帖子:

http://code.google.com/p/gmaps-api-issues/issues/detail?id=4659

希望能帮助到你。

于 2013-08-21T14:28:04.607 回答