TabLayout Erweiterung über nicht ganze Bildschirmbreite
Ich mag den Raum füllen links und rechts von meinem TabLayout aswell, so dass es den ganzen Bildschirm ausfüllt. Aber ich kann es einfach nicht zur Arbeit bringen. Das ist meine Layout.xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="cytek2806northman.tabtestproject.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_height = "wrap_content"
android:layout_width = "match_parent"
>
<android.support.design.widget.TabLayout
android:layout_height = "wrap_content"
android:layout_width = "match_parent"
android:id="@+id/tabLayout"
app:tabMode="scrollable"
app:tabGravity="fill"
>
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/viewPager">
</android.support.v4.view.ViewPager>
</RelativeLayout>
Bitte posten Sie Ihre Lösung als Antwort –