我使用Android Studio(抽屉和标签)的布局,标签是在一个片段。标签不是整个屏幕
正如您在下面的屏幕截图中看到的,它们不在工具栏下,并显示在中间。可能是什么问题呢?
制表main.xml中
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
app:tabGravity="fill"
app:tabMode="fixed"
android:background="@color/material_blue_grey_800"
app:tabIndicatorColor="@color/orange"
app:tabSelectedTextColor="@color/orange"
app:tabTextColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v4.view.ViewPager>
</LinearLayout >
发布您的布局xml – FarshidABZ
从活动/片段创建自动生成的布局现在有paddings = 16dp,只需删除它们 –
You inc这个标签主要xml在某处。显示太 –