Cuando creo un TabItem dentro de un Tablyout me generan errore; además, no me permite ver la visualización del diseño debido al error.
1. Render problema: Style ResourceReference{namespace=apk/res-auto, type=attr, name=textAppearanceButton} is not of type STYLE (instead attr)
2. Render problem: Failed to find style with 2131033031
3. Render problem:
java.lang.NullPointerException at android.content.res.Resources_Theme_Delegate.obtainStyledAttributes(Resources_Theme_Delegate.java:74) at android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java:1631) at android.content.Context.obtainStyledAttributes(Context.java:874) at android.widget.TextView.setTextAppearance(TextView.java:3965) at androidx.appcompat.widget.AppCompatTextView.setTextAppearance(AppCompatTextView.java:216) at com.google.android.material.textview.MaterialTextView.setTextAppearance(MaterialTextView.java:106) at android.widget.TextView.setTextAppearance(TextView.java:3954) at androidx.core.widget.TextViewCompat.setTextAppearance(TextViewCompat.java:289) at com.google.android.material.tabs.TabLayout$TabView.updateTab(TabLayout.java:2772) at com.google.android.material.tabs.TabLayout$TabView.update(TabLayout.java:2801) at com.google.android.material.tabs.TabLayout$TabView.setTab(TabLayout.java:2713) at com.google.android.material.tabs.TabLayout.createTabView(TabLayout.java:1673) at com.google.android.material.tabs.TabLayout.newTab(TabLayout.java:956) at com.google.android.material.tabs.TabLayout.addTabFromItemView(TabLayout.java:824) at com.google.android.material.tabs.TabLayout.addViewInternal(TabLayout.java:1730) at com.google.android.material.tabs.TabLayout.addView(TabLayout.java:1720) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:1131) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1101) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:1130) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1101) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:1130) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1101) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.inflate(LayoutInflater.java:686) at android.view.LayoutInflater.inflate(LayoutInflater.java:505)
4. No speakable text present: This item may not have a label readable by screen readers.
A continuación presento el código:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tablayout"
android:background="@color/black"
app:tabIconTint="@color/white"
app:tabIndicatorColor="@color/yellow"
app:tabSelectedTextColor="@color/yellow"
app:tabTextColor="@color/white"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<com.google.android.material.tabs.TabItem
android:id="@+id/tabcategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Category"/>
<com.google.android.material.tabs.TabItem
android:id="@+id/tabhome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Home"/>
<com.google.android.material.tabs.TabItem
android:id="@+id/tabreciente"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Reciente"/>
</com.google.android.material.tabs.TabLayout>
</LinearLayout>
</RelativeLayout>