[英]How to list <item name="app:fabSize">[value]</item> in styles.xml?
I tried to include the app:fabSize in styles.xml but android studio threw an error我试图在styles.xml 中包含app:fabSize 但android studio 抛出了一个错误
Is there any way to include the app:fabSize and other app: attributes in styles.xml?有没有办法在styles.xml 中包含app:fabSize 和其他app: 属性?
When adding Compat attributes in layout.xml one should use previously defined namespace (it doesn't have to be app
actually, but should be defined in xml via xmlns:
- for example having hello
as a namespace is also possible. Anyway app
is some kind of a standard).当在 layout.xml 中添加 Compat 属性时,应该使用先前定义的命名空间(它实际上不必是
app
,但应该通过xmlns:
在 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"/>
But in styles.xml to use Compat attributes one shouldn't put anything, but attribute name:但是在styles.xml中使用Compat属性不应该放任何东西,而是属性名称:
<style name="StyleName">
<item name="fabSize">mini</item>
</style>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.