Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Viewpager获取屏幕中的所有剩余高度,即使它为';s的高度是包裹内容_Android_Android Viewpager_Android Xml - Fatal编程技术网

Android Viewpager获取屏幕中的所有剩余高度,即使它为';s的高度是包裹内容

Android Viewpager获取屏幕中的所有剩余高度,即使它为';s的高度是包裹内容,android,android-viewpager,android-xml,Android,Android Viewpager,Android Xml,我用XML定义了我的viewpager,如下所示: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorPrimaryDark" androi

我用XML定义了我的viewpager,如下所示:

    <LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorPrimaryDark"
    android:orientation="vertical"
    >   
     ......................

    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager_grid_calendar_recycler"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:background="#387"/>

    </LinearLayout>

......................


可能出了什么问题?

共享完整的xml…我已更新了layout@Enzokie好了:)您放置在viewpager中的视图可能导致问题。检查片段或您使用的内容是否将父布局设置为与父布局匹配。我已更新问题并添加了子布局。但是我的子布局有包装内容共享完整的xml…我已经更新了layout@Enzokie好了:)您放置在viewpager中的视图可能导致问题。检查片段或您使用的内容是否将父布局设置为与父布局匹配。我已更新问题并添加了子布局。但是我的子布局有包装内容
<android.support.v7.widget.RecyclerView
    android:id="@+id/dash_board_grid_calendar_recycler_view"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    tools:listitem="@layout/item_grid_calendar_cell"
    />