Android活动二进制XML文件行:您必须提供layout_width属性

Ant*_*ash 21 android android-layout

我已经读过它,但它仍然在这里.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".TaskEditActivity" >
Run Code Online (Sandbox Code Playgroud)

所以,例外 java.lang.RuntimeException: Binary XML file line #34: You must supply a layout_width attribute.

属性在那里,架构也是......解决方案?

Jac*_*per 32

另外我建议检查你的尺寸.您可能有尺寸的布局宽度,你去它,你有像"150"而不是"150dp"(缺少dp)的值也导致这(这是我的情况)


Ant*_*ash 5

很明显。子元素缺少layout_width属性。


Mar*_*ues 5

我有一个给定宽度的维度,但它没有出现在默认的dimens.xml中

res/
   values-w320dp/
          dimens.xml -> ring_radius=5dp
   values/
          dimens.xml -> missing ring_radius
Run Code Online (Sandbox Code Playgroud)