LAST CẬP NHẬT
<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" />
Sau đó, tôi thêm một tiêu đề vô hình vào danh sách những thứ tương tự như vậy:
@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);
Đây là hầu như không lý tưởng, nhưng nó hoạt động. Tôi hy vọng nó sẽ giúp người ..
[http://stackoverflow.com/questions/25487861/android-maps-markers-bounds-at-the-center-of-top-half-of-map-area](http://stackoverflow.com/question/25487861/android-maps-markers-bounds-at-the-center-of-top-nửa-of-map-area) –