1.在为Button设置android:background="@drawable/main_recordbtn_bg"背景时不生效
解决方法:在res/values/themes.xml 文件中,
parent=“Theme.MaterialComponents.DayNight.DarkActionBar” 修改为
parent=“Theme.MaterialComponents.DayNight.NoActionBar.Bridge” 即可!!
2.使用TabLayout 滑动标签时未生效
先来看一下TabLayout标签的使用
首先需要添加Tablayout的依赖material
然后写页面布局
<?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=".RecordActivity"
android:orientation="vertical"
android:background="@color/grey_f3f3f3">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<ImageView
android:id="@+id/record_iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ih_error"
android:paddingTop="15dp"
android:onClick="onClick"
android:layout_marginLeft="10dp"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/re