[value]?-6ren"> [value]?-我试图在 styles.xml 中包含 app:fabSize 但 android studio 抛出了一个错误 有没有办法在 styles.xml 中包含 app:fabSize 和其他 app: -6ren">
gpt4 book ai didi

android - 如何在 styles.xml 中列出 [value]

转载 作者:太空宇宙 更新时间:2023-11-03 12:46:47 24 4
gpt4 key购买 nike

我试图在 styles.xml 中包含 app:fabSize 但 android studio 抛出了一个错误

enter image description here

有没有办法在 styles.xml 中包含 app:fabSize 和其他 app: 属性?

Here is the code for the style tag

最佳答案

在 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>

关于android - 如何在 styles.xml 中列出 <item name ="app:fabSize">[value]</item>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42108352/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com