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的两种方式 方式(一) 二 ...
随机推荐
- MySql 存储过程总结
MySql 存储过程 -- ---------------------------- -- Procedure structure for `proc_adder` -- -------------- ...
- Unity--------------------万向锁的概念
万向锁 一直困惑我很久....原因出在这里,我以为欧拉角旋转是以模型坐标(齐次坐标系)为旋转轴.问题就来了,无论旋转那个轴,其它两个轴也会相应的变化,下面看图: 根据上面的说明两个旋转面(圆圈)怎么会 ...
- (原创)Python文件与文件系统系列(3)——os.path模块
os.path 模块实现了一些操作路径名字符串的函数,可以通过 import os.path 使用该模块,不过即使仅仅 import os 也可以使用该模块的方法. 1. abspath(path) ...
- DOS批处理基础
1. echo 和 @ 回显命令 @ #表示不显示@后面的命令 echo off #从下一行开始关闭回显 @echo off ...
- Macbook pro安装MacOS系统
在app store 下载系统sierra; 打开磁盘工具,选择优盘,抹掉: 日志式,GUID分区: http://www.cnblogs.com/xiaobo-Linux/ 终端输入命令, sudo ...
- spark not contain
参考网址 http://stackoverflow.com/questions/33608526/is-there-a-way-to-filter-a-field-not-containing-som ...
- php 获取某文件内容
获取某文件下 的文件夹和文件 public function dirRead($dir=''){ //$dir = './upload/images'; $result = ''; if (is_di ...
- 2 go语言的基础
include 内置关键字 注释方法 代码结构(常量,变量,接口,函数的定义) 导入包以及包别名 可见性规则 小练习 内置关键字(25个均为小写) break case chan const cont ...
- Application runtime path "/opt/lampp/htdocs/yii/test/protected/runtime" is not valid. 错误
原因:把windows版的Yii框架写的程序中的拷到Linux去,assets和runtime目录对Group和其他的权限不够.解决方案:点击这2个文件的属性,属性框全选好了,权限777了. cd p ...
- 安装kafka集群
1解压tar包 tar -zxvf kafka_2.-.tgz 2.进入config目录 3.配置server.properties文件 # Licensed to the Apache Softwa ...