我试图从材料组件主题更改样式属性(像colorPrimaryVariant,colorOnSecondary等等),但我收到以下错误:
Android resource linking failed
Output: C:\...\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:3835: error: style attribute 'attr/colorPrimaryVariant (aka com.sample.app:attr/colorPrimaryVariant)' not found.
C:\...\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:3836: error: style attribute 'attr/colorOnPrimary (aka com.sample.app:attr/colorOnPrimary)' not found.
C:\...\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:3839: error: style attribute 'attr/colorSecondaryVariant (aka com.sample.app:attr/colorSecondaryVariant)' not found.
C:\...\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:3840: error: style attribute 'attr/colorOnSecondary (aka com.sample.app:attr/colorOnSecondary)' not found.
error: failed linking references.
Run Code Online (Sandbox Code Playgroud)
这就是我的主题:
<resources>
<!-- Light application theme -->
<style name="CBTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<item name="colorPrimary">@color/cbPrimary</item>
<item name="colorPrimaryDark">@color/cbPrimaryDark</item>
<item name="colorPrimaryVariant">@color/cbPrimaryDark</item>
<item name="colorOnPrimary">#FFFFFF</item>
<item name="colorAccent">@color/cbAccent</item>
<item name="colorSecondary">@color/cbAccent</item>
<item name="colorSecondaryVariant">@color/cbAccentLight</item>
<item name="colorOnSecondary">#FFFFFF</item>
<item name="colorError">@color/cbRed</item> …Run Code Online (Sandbox Code Playgroud) android android-theme material-components material-components-android
我在我的应用程序中使用v7 appcompat库中的ActionBarDrawerToggle,并且在菜单到箭头动画方面遇到了一些麻烦.根据材料设计指南,导航抽屉应与工具栏重叠,打开抽屉时不应使用图标动画,据我所知.
为什么在打开/关闭导航抽屉时默认启用动画,如何禁用它?
另外,如何在其他出现时触发动画?我找到了这个解决方案,但它只适用于Android API 11+,并且可以通过调用setDrawerIndicatorEnabled(false)或工具栏中的扩展ActionView 覆盖.
android android-appcompat android-actionbar navigation-drawer material-design
我有一个Android应用程序,它有一些AdView,到目前为止每个AdView都有自己的AdRequest.但是,每个AdView只使用一个AdRequest是否可行/可推荐?这甚至有所作为吗?(当然它有所作为,但是值得思考吗?)