Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/213.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 带选项卡的查看寻呼机布局超出屏幕范围_Android_Xml_Android Viewpager - Fatal编程技术网

Android 带选项卡的查看寻呼机布局超出屏幕范围

Android 带选项卡的查看寻呼机布局超出屏幕范围,android,xml,android-viewpager,Android,Xml,Android Viewpager,我使用一个选项卡布局,在一个视图页面下方显示所选片段的内容 在布局的顶部是选项卡布局,在视图寻呼机的下方。问题是:视图寻呼机占据了整个屏幕的高度,因此(因为它被限制在导航选项卡上),其高度超出屏幕,如下所示: 我的xml: <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://sc

我使用一个选项卡布局,在一个视图页面下方显示所选片段的内容

在布局的顶部是选项卡布局,在视图寻呼机的下方。问题是:视图寻呼机占据了整个屏幕的高度,因此(因为它被限制在导航选项卡上),其高度超出屏幕,如下所示:

我的xml:

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activities.MeetActivity">

    <com.google.android.material.tabs.TabLayout
        android:id="@+id/navigationTabs"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@drawable/navigation_shadow"
        app:layout_constraintTop_toTopOf="parent"
        app:tabIndicator="@null"
        app:tabMinWidth="@dimen/navigation_height"
        app:tabRippleColor="@null" />

<!--    // the fragment will be displayed here:-->
    <androidx.viewpager.widget.ViewPager
        android:id="@+id/fragmentContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/navigationTabs"/>

有没有办法将“查看寻呼机”限制在导航选项卡的顶部,并强制其高度保持在屏幕的范围内?这看起来可能无关紧要,但会导致片段中的小部件出现在屏幕之外

查看寻呼机显示全屏的高度

ViewPager
onMeasure
函数中,包装内容被计算为容器大小(在这种情况下,
constraraintlayout

试试这个。

查看寻呼机显示全屏的高度

ViewPager
onMeasure
函数中,包装内容被计算为容器大小(在这种情况下,
constraraintlayout

试试这个。

在这里,您的视图寻呼机占据了整个屏幕的高度。请使用 下面的代码显示选项卡下方的查看页面:


在这里,您的视图寻呼机占据了整个屏幕的高度。请使用 下面的代码显示选项卡下方的查看页面:


<androidx.viewpager.widget.ViewPager
        android:id="@+id/fragmentContainer"
        android:layout_width="match_parent"
        android:layout_height="0dp" 
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/navigationTabs" />