耗了很长时间都没发现什么原因,最后无意间看到布局文件中<com.amap.api.MapView>外面套了一层<RelativeLayout>,将<RelativeLayout>换成<LinearLayout>后显示正常,布局文件如下:
<android.support.v4.widget.SwipeRefreshLayout android:id="@+id/srl_flash_about_us" android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black_2c"> <com.amap.api.maps.MapView android:id="@+id/mv_map" android:layout_width="match_parent" android:layout_height="300dp" android:background="@color/write" /> </LinearLayout> </android.support.v4.widget.SwipeRefreshLayout>