繁体   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