Androidの疑难杂症之加载布局报Error inflating class <unknown>
android.view.InflateException: Binary XML file line #12: Error inflating class <unknown>
出现这种错误有可能是,你的布局当中某个wedget的属性出错,比如引用了?attr/xxxx,但是你的主题里面却没有给这个attr赋值。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llPlaceHolderLoading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="?attr/primary_page_background"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible" > <ProgressBar
style="@style/AppTheme.Widget.Progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" /> <TextView
android:id="@+id/tvLoadTip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="?attr/loading_tip"
android:textColor="@color/progress_tips_text_color"
android:textAppearance="?android:attr/textAppearanceMedium" /> </LinearLayout>
像这样的在style里面没有把attr赋值,这个界面是加载不错来,并且报错
02-03 17:24:50.746: E/AndroidRuntime(10702): java.lang.RuntimeException: Unable to start activity ComponentInfo{net.realtor.app.extranet.cmls/net.realtor.app.extranet.cmls.ui.activity.TestActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class android.widget.ProgressBar
Androidの疑难杂症之加载布局报Error inflating class <unknown>的更多相关文章
- 【Android】异步加载布局探索
最近在做的项目页面复杂导致布局嵌套多层,而且又使用了百分比布局(可能主要是这个原因)导致页面加载的时候主线程会被阻塞, 那要想减少主线程阻塞,一来就是简化布局,减轻LayoutInflater的负担, ...
- Android -- 加载布局
如果在Activity中用到了别的Layout ,比如对话框等,你还要使用对话框中的组件,如TextView等,必须要先加载布局,然后才能使用里面的控件, 如 : View view = View.i ...
- Android四大组件之Activity(活动)及其布局的创建与加载布局
Android四大组件之Activity(活动)及其布局的创建与加载布局 什么是Activity ? 活动(Activity)是包含用户界面的组件,主要用于和用户进行交互的,一个应用程序中可以包含零个 ...
- Android动态加载布局之LayoutInflater【转】
万分感谢大佬:https://www.jianshu.com/p/6a235ba5ee17 深入了解View<一>之Android LayoutInfalter原理分析 下文为:Layou ...
- RecyclerView的使用之多种Item加载布局
精益求精,为了更加透彻熟练得掌握,本文再次给大家介石介绍下如何利用RecyclerView实现多Item布局的加载,多Item布局的加载的意思就是在开发过程中List的每一项可能根据需求的不同会加载不 ...
- Android 高清加载巨图方案 拒绝压缩图片
Android 高清加载巨图方案 拒绝压缩图片 转载请标明出处: http://blog.csdn.net/lmj623565791/article/details/49300989: 本文出自:[张 ...
- Android图片异步加载之Android-Universal-Image-Loader
将近一个月没有更新博客了,由于这段时间以来准备毕业论文等各种事务缠身,一直没有时间和精力沉下来继续学习和整理一些东西.最近刚刚恢复到正轨,正好这两天看了下Android上关于图片异步加载的开源项目,就 ...
- Android图片异步加载之Android-Universal-Image-Loader(转)
今天要介绍的是Github上一个使用非常广泛的图片异步加载库Android-Universal-Image-Loader,该项目的功能十分强大,可以说是我见过的目前功能最全.性能最优的图片异步加载解决 ...
- [Android] Android ViewPager 中加载 Fragment的两种方式 方式(二)
接上文: https://www.cnblogs.com/wukong1688/p/10693338.html Android ViewPager 中加载 Fragmenet的两种方式 方式(一) 二 ...
随机推荐
- Spring JDBC StoredProcedure类示例
org.springframework.jdbc.core.StoredProcedure类是RDBMS存储过程的对象抽象的超类.这个类是抽象的,目的是让子类将提供一个用于调用的类型化方法,该方法委托 ...
- 导入Maven项目后,Eclipse提示“Missing artifact ”类的错误
导入Maven项目后,Eclipse提示“Missing artifact ”类的错误 标签: Maven Missing art 2016-08-15 16:05 679人阅读 评论(0) 收藏 举 ...
- CSS :after、before、<!DOCTYPE>
<!DOCTYPE> <!DOCTYPE> 声明必须是 HTML 文档的第一行,位于 <html> 标签之前. CSS :选择器 after,before
- TCP三次握手建立关系
三次握手(three times handshake:three-way handshake)所谓的“三次握手”即对每次发送的数据量是怎样跟踪进行协商使数据段的 发送和接收同步,根据所接收到的数据量而 ...
- hbase深入了解
http://blog.csdn.net/u010967382/article/details/37878701?utm_source=tuicool&utm_medium=referral ...
- MSM--Memcached_Session_Manager介绍及使用
MSM--Memcached_Session_Manager介绍及使用 http://www.iteye.com/topic/1125301 我们都知道对于一些大型的web2.0的网站,在正式部署时一 ...
- Lua中用Split函数分割字符串
function Split(szFullString, szSeparator) local nFindStartIndex = local nSplitIndex = local nSplitAr ...
- MVC阻止用户注入JavaScript代码或者Html标记
使用HttpUtility.HtmlEncode("")将字符串进行过滤处理
- 总结的比较好的OpenGL教程
OpenGL Programming Guide(红宝书) http://www.glprogramming.com/red/ OpenGL Reference Manual(蓝宝书) http:// ...
- Python打包-py2exe
上篇文章讲了pyinstaller,可以打包成包含Windows, Linux, Mac OS X, FreeBSD, Solaris and AIX等操作系统下的可执行文件,如果只针对Windows ...