LAST UPDATE
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<fragment
android:id="@+id/map_fragment"
android:name="com.myapp.MapFragment"
android:layout_width="match_parent"
android:layout_height="fill_parent" />
<fragment
android:id="@id/list_fragment"
android:name="com.myapp.ListFragment"
android:layout_width="wrap_content"
android:layout_height="fill_parent" />
Dann füge ich einen unsichtbaren Header in die Liste wie folgt:
@Override
public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View view = inflater.inflate(R.layout.listview, container, false);
SwipeListView listView = (SwipeListView) view.findViewById(R.id.venue_list);
// An invisible view added as a header to the list and clicking it leads to the mapfragment
TextView invisibleView = new TextView(inflater.getContext());
invisibleView.setBackgroundColor(Color.TRANSPARENT);
invisibleView.setHeight(300);
invisibleView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
listener.moveToMapFragment();
}
});
listView.addHeaderView(invisibleView);
Diese kaum ideal ist, aber es funktioniert. Ich hoffe es hilft jemandem ..
[http://stackoverflow.com/questions/25487861/android-maps-markers-bounds-at-the-center-of-top-half-of-map-area](http://stackoverflow.com/questions/25487861/android-maps-markers-bounds-in-der-Mitte-der-oberen-Hälfte-der-Karte-Bereich) –