簡體   English   中英

TabLayout - 找不到屬性的資源標識符

[英]TabLayout - No resource identifier found for attribute

我正在使用TabLayout ,這是在新的android小部件包android.support.design.widget.TabLayout引入的

昨天我的代碼運行正常,現在我今天開始使用我的計算機,並嘗試重新構建項目,現在Compiler先生說下面的錯誤

Error:(22) No resource identifier found for attribute 'eleMode' in package 'android'
Error:(22) No resource identifier found for attribute 'tabGrvation' in package 'android.com.hsc.yatra'
Error:(22) No resource identifier found for attribute 'tabavity' in package 'android.com.hsc.yatra'

請指導我哪里不對? 所以我的編譯器很開心,然后編譯項目。

這是我的XML,其中發生了原始錯誤

<android.support.design.widget.CoordinatorLayout 

    xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <!--<android.support.v7.widget.Toolbar-->
            <!--android:id="@+id/toolbar"-->
            <!--android:layout_width="match_parent"-->
            <!--android:layout_height="?attr/actionBarSize"-->
            <!--android:background="?attr/colorPrimary"-->
            <!--app:layout_scrollFlags="scroll|enterAlways"-->
            <!--app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />-->
            <include layout="@layout/toolbar_searched_bus">

            </include>

            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:eleMode="fixed"
                app:tabGrvation="2dp"
                app:tabavity="fill" />
        </android.support.design.widget.AppBarLayout>

        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    </android.support.design.widget.CoordinatorLayout>

將支持庫添加到build.gradle(Module:app) ,如下所示,

dependencies {
 compile 'com.android.support:design:24.+'
}

xml屬性中存在拼寫錯誤。 將屬性更改為以下內容並嘗試。

<android.support.design.widget.TabLayout
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:elevation="2dp"
    app:tabMode="fixed"
    app:tabGravity="fill"/>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM