Я использую TabLayout
с ViewPager
, чтобы отобразить мои имена вкладок, как показано ниже.Изменить вкладки TabLayout размещения
Но как вы можете видеть мое название покрывает мои закладки. Я хочу, чтобы мои вкладки были ближе к верхней части экрана, как показано ниже.
Вот мой view_pager.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="fill_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="stellar.kade_c.com.MainActivity">
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed" />
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
Как это может быть достигнуто?
Пожалуйста, обратитесь андроида улей учебник http://www.androidhive.info/2015/09/android-material-design-working-with-tabs/ –