activity_main.xml 1.3 KB

1234567891011121314151617181920212223242526272829
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent"
  6. android:background="#F5F8FF">
  7. <androidx.viewpager2.widget.ViewPager2
  8. android:id="@+id/main_view_pager"
  9. android:layout_width="match_parent"
  10. android:layout_height="0dp"
  11. app:layout_constraintBottom_toTopOf="@id/main_tab_layout"
  12. app:layout_constraintTop_toTopOf="parent" />
  13. <com.google.android.material.tabs.TabLayout
  14. android:id="@+id/main_tab_layout"
  15. android:layout_width="0dp"
  16. android:layout_height="0dp"
  17. android:layout_marginBottom="32dp"
  18. android:background="@drawable/bg_main_tab"
  19. android:translationZ="2dp"
  20. app:layout_constraintBottom_toBottomOf="parent"
  21. app:layout_constraintDimensionRatio="264:47"
  22. app:layout_constraintLeft_toLeftOf="parent"
  23. app:layout_constraintRight_toRightOf="parent"
  24. app:layout_constraintWidth_percent="0.7333333333333333"
  25. app:tabIconTint="@android:color/transparent"
  26. app:tabIndicator="@null" />
  27. </androidx.constraintlayout.widget.ConstraintLayout>