如何在styles.xml中列出<item name =“ app:fabSize”> [value] </ item>?

Aru*_*ava 3 android android-layout android-studio floating-action-button

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

在此处输入图片说明

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

这是样式标签的代码

kro*_*kin 5

在layout.xml中添加Compat属性时,应使用先前定义的名称空间(实际上并不一定要使用它app,但应通过xml在xml中定义xmlns:-例如,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"/>
Run Code Online (Sandbox Code Playgroud)

但是在styles.xml中使用Compat属性时,不应放置任何东西,而应放置属性名称:

<style name="StyleName">
    <item name="fabSize">mini</item>
</style>
Run Code Online (Sandbox Code Playgroud)