0
  • 最佳答案

    解决了 解决了 是我自己通过映射改变下划线的时候,没考虑好margin的值 这小bug花了我好久啊= =

    1279706481779875840  评论     打赏       一日就是一天
    • <?xml version="1.0" encoding="utf-8"?>
      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context=".MainActivity"
          android:orientation="vertical">
      
          <!--    <androidx.appcompat.widget.Toolbar-->
          <!--        android:id="@+id/main_toolbar"-->
          <!--        android:layout_width="match_parent"-->
          <!--        android:layout_height="30dp"-->
          <!--        android:background="#FC654D"-->
          <!--        android:minHeight="?attr/actionBarSize"-->
          <!--        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"-->
          <!--        app:layout_constraintEnd_toEndOf="parent"-->
          <!--        app:layout_constraintStart_toStartOf="parent"-->
          <!--        app:layout_constraintTop_toTopOf="parent"-->
          <!--        app:popupTheme="@style/Theme.AppCompat.Light" />-->
      
          <LinearLayout
              android:layout_width="match_parent"
              android:layout_height="40dp"
              android:background="@color/colorJu">
      
              <com.google.android.material.tabs.TabLayout
                  android:id="@+id/main_tab_layout"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="3"
                  android:background="@color/colorJu"
                  app:tabBackground="@null"
                  app:tabIndicatorColor="#fff"
                  app:tabIndicatorHeight="5dp"
                  app:tabRippleColor="@null"
                  app:tabSelectedTextColor="#000"
                  app:tabTextAppearance="@style/TabLayoutText"
                  app:tabTextColor="#fff"
                  app:tabMode="fixed"/>
      
              <RelativeLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1">
      
                  <ImageView
                      android:layout_width="30dp"
                      android:layout_height="30dp"
                      android:layout_centerInParent="true"
                      android:src="@mipmap/ic_search"/>
              </RelativeLayout>
          </LinearLayout>
      
      
          <androidx.viewpager.widget.ViewPager
              android:id="@+id/main_view_page"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:overScrollMode="never"/>
      
      </LinearLayout>
      


      1279706481779875840  评论     打赏       一日就是一天
      • 布局是根据视频里面一样布局的

        1279706481779875840  评论     打赏       一日就是一天
        • 余乐  回复 @一日就是一天
          xml文件属性发出来看看
          余乐 2020-07-09 17:34   回复 1245269923161182208
        • 一日就是一天  回复 @余乐
          老哥发了发了 帮忙看看呀
          一日就是一天 2020-07-09 17:59   回复 1279706481779875840
      相关问题
      2019-10-13 04:29 810 2
      你可长丶心吧 · 喜马拉雅
      2019-11-15 22:54 598 2
      2019-12-23 23:31 1303 2
      2020-01-06 04:50 1484 2