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/ –