您的每一个用心回答,都会让这个世界变得更美好一些!
解决了 解决了 是我自己通过映射改变下划线的时候,没考虑好margin的值 这小bug花了我好久啊= =
<?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>
布局是根据视频里面一样布局的
解决了 解决了 是我自己通过映射改变下划线的时候,没考虑好margin的值 这小bug花了我好久啊= =
布局是根据视频里面一样布局的