带有滑动标签的Android操作栏第二个标签未加载

时间:2014-04-30 06:39:21

标签: android android-fragments tabs

我是初学Android开发人员,我从滑动菜单中遇到第二个标签问题。 第一个选项卡需要在片段上加载地图并绘制内容,第二个选项卡需要加载一些数据。 当滑动到第二个标签时,它没有显示除第一个标签中的几个像素之外的任何内容。 如果我旋转设备,则第二个选项卡将被加载。 注意:我使用的是Android 4.0.3操作系统,但在更高版本上加载时,它的核心工作

第一个标签

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/FrameLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <fragment
        android:id="@+id/pager_map"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="wrap_content"
        android:layout_height="match_parent" />

</FrameLayout>

第二个标签

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/FrameLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView" />

</FrameLayout>

请注意,如果我用其他元素替换地图,滑动工作正常。 谢谢你的时间。

0 个答案:

没有答案
相关问题