ANDROID开发之问题积累及解决方案(二)
错误:“Binary XML file line # : Error inflating class”
原因:此异常是布局文件中有错引起的,那么返回到布局文件中看看。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/disclosureImg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"/> <TextView
android:id="@+id/contentText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/disclosureImg"/> </RelativeLayout>
在imageview处有个黄感叹号,鼠标放上去显示“[Accessibility] Missing contentDescription attribute on image”,就是说图片缺少文本说明。。。。,找到地方就知道怎么办了,缺少说明就给他加一个嘛。
android:contentDescription="@string/icon_description"
加上这个属性后问题就解决了,so。。。这些小细节需多注意,尽量避免这样的错吧~
另:也可参考这位朋友的方案——Android运行时异常“Binary XML file line # : Error inflating class”。
ANDROID开发之问题积累及解决方案(二)的更多相关文章
- ANDROID开发之问题积累及解决方案(一)
一.activity跳转及传值 当进行activity之间的跳转时我们会遇到这样的问题.首先熟悉下activity之间跳转.Activity跳转与传值,主要是通过Intent类来连接多个Activit ...
- ANDROID开发之问题积累及解决方案(三)
1.dexDebug ExecException finished with non-zero exit value 2需要在gradle中配置下面的代码,原因是引用了多个libraries文件 de ...
- ANDROID开发之问题积累及解决方案(四)
首先贴出问题类型: 程序无法启动,查看logcat,提示如下信息: W/dalvikvm(679): PR_CAPBSET_DROP 32 failed: Invalid argument. Plea ...
- Android开发之异步具体解释(二)之AsyncTask
请尊重他人的劳动成果,转载请注明出处:Android开发之异步具体解释(二)之AsyncTask http://blog.csdn.net/fengyuzhengfan/article/details ...
- Android开发8:数据存储(二)——SQLite数据库和ContentProvider的使用
前言 啦啦啦各位小伙伴们许久不见了~学期末和过年期间自己忙着做其他事没能及时更新Android开发系列课程的博客,实在是罪过罪过~ 好啦~废话不多说,进入我们今天的主题.今天我们将和大家学习其他的数据 ...
- Android 开发有用代码积累
Android开发需求变化快,开发周期要求尽量短,接下来一系列文章从实际使用出发总结一些常用的代码片段,便于查找,也为后来人提供一份参考. 1.获取Manifest的基本信息(升级页面和软件关于页面一 ...
- Android开发——ListView使用技巧总结(二)
0. 前言 Android中的ListView是用的比较多的控件之一,在上一篇Android开发--ListView使用技巧总结(一)中对ListView的ViewHolder机制.优化卡顿方式以及 ...
- Android开发—智能家居系列】(二):用手机对WIFI模块进行配置
在实际开发中,我开发的这款APP是用来连接温控器,并对温控器进行控制的.有图为证,哈哈. 上一篇文章[Android开发—智能家居系列](一):智能家居原理的文末总结中写到: 手机APP控制智能温控器 ...
- android开发实战-记账本APP(二)
继昨天的开发,继续完成今天的内容. (一)开始构建一些业务逻辑,开始构建记账本的添加一笔记账的功能. ①对fab按钮的click时间进行修改,创建一个AlertDialog.Builder对象,因此我 ...
随机推荐
- LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
连接器LNK是通过调用cvtres.exe完成文件向coff格式的转换的,所以出现这种错误的原因就是cvtres.exe出现了问题. 在电脑里面搜索一下cvtres.exe,发现存在多个文件,使用最新 ...
- asp.net中如何调取数据库中存储过程输出的两个变量
public DataTable GetList_GenqtyNumPrice(int _peoid, int _genstorageid,int _goodsid) { DataSet ds = n ...
- Could not parse mapping document from input stream hibernate配置异常
十二月 , :: 下午 org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context ...
- C# 基础排序与查找算法
排序算法: class Sort { static void swap<T>(ref T a, ref T b) { T tmp = a; a = b; b = tmp; } #regio ...
- LeetCode-179. Largest Number
179. Largest Number Given a list of non negative integers, arrange them such that they form the larg ...
- flag--命令行参数解析之StringVar
func StringVar func StringVar(p *string, name string, value string, usage string) StringVar定义了一个有指定名 ...
- Debian7下初次尝试Nginx+Uwsgi部署Django开发环境
之前一直都用的是新浪的SAE,但是由于各种限制,各种不爽,终于下定决心开始折腾VPS,于是在搬瓦工上买了个年付VPS,开始折腾之旅. 由于对Linux一窍不通,所以不知道如何在Linux上部署开发环境 ...
- POI 设置
FileOutputStream fos = new FileOutputStream("D:\\15.xls"); HSSFWorkbook wb = new HSSFWorkb ...
- linux下wps,系统缺失字体:wingdings、wingdings 2、wingdings3
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAArcAAACdCAIAAAAhV8dZAAAgAElEQVR4nOzdd1wT9/8H8OvXfjvtt8
- C#的自定义滚动条
VS工具箱自带的滚动条,不能设置颜色. 在网上找资源,找到一个控制TextBox的垂直滚动条,链接为http://www.cnblogs.com/2seek/p/4455079.html 在这个的基础 ...