【发布时间】:2017-03-12 23:21:09
【问题描述】:
我设置了一个资源维度:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="font_size">36sp</dimen>
<dimen name="layout_height">wrap_content</dimen>
<dimen name="layout_width">wrap_content</dimen>
</resources>
并使用以下内容引用它:
<Button
android:layout_columnWeight="1"
android:background="@drawable/button_style"
android:id="@id/btnAC"
android:layout_width="@dimen/layout_width"
android:layout_height="@dimen/layout_height"
android:text="@string/valAC"
android:textColor="@color/white"
android:textSize="@dimen/font_size" />
但在尝试运行应用程序时出现以下错误。 错误:(100, 33) 不允许使用字符串类型(在 'layout_height' 处,值为 'wrap_content')。
【问题讨论】:
标签: android android-layout compiler-errors