【发布时间】:2017-02-08 08:42:02
【问题描述】:
我尝试将 app:fabSize 包含在 styles.xml 中,但 android studio 抛出错误
有没有办法在styles.xml 中包含app:fabSize 和其他app: 属性?
【问题讨论】:
-
没有
app:。
标签: android android-layout android-studio floating-action-button
我尝试将 app:fabSize 包含在 styles.xml 中,但 android studio 抛出错误
有没有办法在styles.xml 中包含app:fabSize 和其他app: 属性?
【问题讨论】:
app:。
标签: android android-layout android-studio floating-action-button
在 layout.xml 中添加 Compat 属性时,应使用先前定义的命名空间(实际上不必是 app,但应通过 xmlns: 在 xml 中定义 - 例如将 hello 作为命名空间也可以。反正app是某种标准)。
<android.support.design.widget.FloatingActionButton
xmlns:hello="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
hello:fabSize="mini"/>
但是在styles.xml 中使用Compat 属性不应该放任何东西,但是属性名称:
<style name="StyleName">
<item name="fabSize">mini</item>
</style>
【讨论】: