![](/img/trans.png)
[英]Is there a way to change visibility of an item when switching app theme from styles.xml?
[英]How to list <item name="app:fabSize">[value]</item> in styles.xml?
我试图在styles.xml 中包含app:fabSize 但android studio 抛出了一个错误
有没有办法在styles.xml 中包含app:fabSize 和其他app: 属性?
当在 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"/>
但是在styles.xml中使用Compat属性不应该放任何东西,而是属性名称:
<style name="StyleName">
<item name="fabSize">mini</item>
</style>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.