简体   繁体   English

如何列出<item name="app:fabSize"> [价值]</item> 在styles.xml 中?

[英]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: 属性?

Here is the code for the style tag这是样式标签的代码

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.

相关问题 从 styles.xml 切换应用程序主题时,是否可以更改项目的可见性? - Is there a way to change visibility of an item when switching app theme from styles.xml? 什么是 Android 项目中 styles.xml 文件中的 windowSplashscreenContent 项 - What is a windowSplashscreenContent item in the styles.xml file in an Android project 如何使用styles.xml 从NavigationDrawer 菜单更改项目文本颜色? - How to change item text color from a NavigationDrawer menu using styles.xml? 键入错误:检索项目的父项时出错:未找到与给定名称&#39;Theme.AppCompat.Light&#39;匹配的资源。 styles.xml Android AAPT - Type error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. styles.xml Android AAPT 如何将默认工具栏标题文本从@string/app_name 更改为“”,但仅更改 styles.xml? - How to change default Toolbar title text from @string/app_name to “”, but only changing styles.xml? 如何在styles.xml中设置操作栏样式 - How to style Action Bar in styles.xml 如何修复Android中styles.xml中的错误? - How to fix errors in styles.xml in android? 如何在styles.xml中设置矢量可绘制对象 - How to set vector drawables in styles.xml 如何使用styles.xml自定义SpinnerItemStyle - How to customized SpinnerItemStyle with styles.xml 如何在styles.xml中设置TextInputEditText的样式 - How to set the style of TextInputEditText in styles.xml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM