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
      相关问题
      拉大锯 · 提问
      2020-01-19 07:56 796 2
      CHENJIAHUA · 提问
      2020-02-15 04:43 690 2
      我不行了 · 提问 / 服务
      2020-02-17 04:03 871 2
      夙夜星辰叹 · 提问
      2020-07-08 18:34 935 2
      Miyako · 提问
      2020-08-14 03:17 469 2
      进阶 · 提问
      2020-10-04 18:41 881 2
      2021-12-03 23:44 410 2
      幻影~ · 提问
      2024-04-13 20:13 35 2
      资质平平 · Android
      2025-02-20 09:14 96 100