错误: java.lang.RuntimeException: Binary XML file line #7: You must supply a layout_height attribute.

java.lang.RuntimeException: Binary XML file line #7: You must supply a layout_height attribute.

这个错误有可能是你指定了高度,但是在对应的dpi下没有声明这个dimen高度导致的错误。

<RelativeLayout

android:layout_width="match_parent"

android:layout_height="@dimen/titlebar_height" >

这个,你在xhdpi下定义了:

<dimen name="titlebar_height">50dp</dimen>

但是hdpi下没有,那么在hdpi下运行的程序就会报上面那个错误。

时间: 2024-11-08 10:14:47

错误: java.lang.RuntimeException: Binary XML file line #7: You must supply a layout_height attribute.的相关文章

Android错误之java.lang.RuntimeException: Binary XML file line #160: You must supply a layout_width attr

在调整布局后运行项目出现如下错误: 我们根据提示找到布局文件的160行: 发现忘记定义宽度属性,添加: 则编译正常通过. 喜欢的朋友请关注我哦!谢谢支持! 版权声明:本文为博主原创文章,未经博主允许不得转载.

android Caused by: java.lang.IllegalArgumentException: Binary XML file line #7: Must specify unique

今天写了一个静态得fragment,好久没写了,一写就出现问题了,先看下布局文件 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height=&qu

ILJMALL project过程中遇到Fragment嵌套问题:IllegalArgumentException: Binary XML file line #23: Duplicate id

出现场景:当点击"分类"再返回"首页"时,发生error退出 BUG描述:Caused by: java.lang.IllegalArgumentException: Binary XML file line #23: Duplicate id 0x7f0d0054, tag null, or parent id 0xffffffff with another fragment for com.example.sxq123.iljmall.FragmentCatag

Android项目部署时,发生AndroidRuntime:android.view.InflateException: Binary XML file line #168: Error inflating class错误

这个错误也是让我纠结了一天,当时写的项目在安卓虚拟机上运行都很正常,于是当我部署到安卓手机上时,点击登陆按钮跳转到用户主界面的时候直接结束运行返回登陆界面.    当时,我仔细检查了一下自己的代码,并没有发现什么问题,在logcat上显示的报错如下:AndroidRuntime:android.view.InflateException: Binary XML file line #168: Error inflating class(这是其中报错的最主要的一行信息).  于是我在百度上几乎查看

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.LoginActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.LoginActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class 异常解决方案: 是因为设置background的图片太大了,造成了内存溢出,在Activity设置onCreate

错误解决:android.view.InflateException: Binary XML file line #11: Error inflating class com.tony.timepicker.TimePicker

今天在做项目开发时遇到这么一个错误,完整的错误提示信息如下: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tony.timepicker/com.tony.timepicker.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class com.tony.timepicke

Binary XML file line #7: Error inflating class fragment

这几天一直在学习碎片,想自己写一个相关的程序试试,没想到刚写一点就出了问题. 在加载主布局文件activity_main.xml时候,出现错误 06-12 13:11:12.873: E/AndroidRuntime(2022): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gentleni.demo_grideview_002/com.gentleni.demo_grideview_002.Mai

bug_ _图片_android.view.InflateException: Binary XML file line #1: Error inflating class &lt;unknown&gt;

=========== 1   java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zgan.community/com.zgan.community.activity.CommunityPolicitalDetailActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class <unknow

Binary XML file line #2: Error inflating

06-27 14:29:27.600: E/AndroidRuntime(6936): FATAL EXCEPTION: main 06-27 14:29:27.600: E/AndroidRuntime(6936): android.view.InflateException: Binary XML file line #2: Error inflating class com.example.FileListItem 06-27 14:29:27.600: E/AndroidRuntime(