error: No resource identifier found for attribute ‘footerColor’ in package
2016-04-12 11:15
232 查看
异常提示:
使用自定义控件,引用包名应该是AndroidManifest.xml中所定义的包路径,并非src下.java文件所指向的包,这个容易犯错!否者Android studio 中的xml布局界面,运行后会提示以下错误:
error: No resource identifier found for attribute ‘footerColor’ in package
一般情况下,加上这一句就可以了,特殊情况下,再根据上边那种实现
xmlns:app="http://schemas.android.com/apk/res-auto"
参考xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/container" xmlns:android="http://schemas.android.com/apk/res/android" package="com.lvche.app" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res/com.lvche.app" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentBottom="true" android:background="@color/white_pure" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="bottom" android:orientation="vertical" tools:ignore="UselessParent"> <RelativeLayout android:id="@+id/topbanner" android:layout_width="match_parent" android:layout_height="@dimen/height_top_bar" android:background="@color/banner_bgcolor" android:gravity="center_vertical"> <TextView android:id="@+id/topbanner_showtext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="我的收藏" android:textColor="#ffffff" android:textSize="23sp"/> <Button android:id="@+id/topbanner_setting" android:layout_width="60dp" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:background="@color/orange" android:onClick="save" android:textColor="#fff" android:textSize="18sp" android:visibility="gone"/> </RelativeLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="vertical" tools:ignore="InefficientWeight"> <com.lvche.app.incubator.ui.componennt.tabbarview.ui.TitleIndicator android:id="@+id/pagerindicator" android:layout_width="fill_parent" android:layout_height="50dp" android:background="#ffffff" app:footerColor1="@color/tab_indicator_text_selected" app:footerLineHeight1="0dp" app:footerTriangleHeight1="3.0dp" app:textColor="@color/tab_indicator_text" app:textSizeNormal="@dimen/common_text_size_middle_2" app:textSizeSelected="@dimen/common_text_size_middle_2" /> <RelativeLayout android:layout_width="fill_parent" android:layout_height="1.0dp" android:background="#eeeeee"> </RelativeLayout> <!-- Don't set background for ViewPager. It doesn't work because of page margin --> <com.lvche.app.incubator.ui.componennt.tabbarview.ui.ViewPagerCompat android:id="@+id/pager" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" android:clickable="false" android:duplicateParentState="true"/> </LinearLayout> </LinearLayout> </RelativeLayout>
相关文章推荐
- 驱动工程中添加新文件后出现的“cannot open source file '***.tmh'"编译错误
- Openstack学习笔记(九)-nova学习笔记(一)
- myeclipse9.0安装svn插件
- Trie树:应用于统计和排序
- Hibernate - Batch update returned unexpected row count from update: 0 actual row count: 0 expected:
- 分布式计算概念一览
- 第五章 consul key/value
- RecyclerView
- GetWindowRect和GetClientRect的区别详解
- PYTHON 併行
- Mysql 联结表
- glibc下载安装
- Scalaz(38)- Free :Coproduct-Monadic语句组合
- [C++] C++的运算符重载(+、-、前置--、后置--,前置++,后置++、==)
- Android Studio编译输出apk文件修改文件名
- Unsupported major.minor version 原理
- 欢迎使用CSDN-markdown编辑器
- STL Algorithms in Action
- Scalaz(38)- Free :Coproduct-Monadic语句组合
- WindowsCE project missing Microsoft.CompactFramework.CSharp.targets in Visual Studio 2008