android - 是否可以在 Android 导航组件中为事务设置默认动画主题?
问题描述
我想像这样更改 Android 导航组件的默认事务动画:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="enterAnim">@anim/slide_in_left</item>
<item name="exitAnim">@anim/slide_out_left</item>
<item name="popEnterAnim">@anim/slide_in_left</item>
<item name="popExitAnim">@anim/slide_out_left</item>
</style>
在这种情况下,它不起作用。你有什么主意吗?
解决方案
导航的发行说明2.4.0-alpha02
说:
通过 XML 膨胀元素时,动画属性可以使用从主题中提取的属性,使用 app:enterAnim="?attr/transitionEnter" 语法
所以,是的,现在可以为导航操作设置默认动画。
推荐阅读
- node.js - Discord Js,从我所在的语音频道创建邀请
- python - matplotlib:以像素为单位的 png 图像的轴大小
- c# - 如何让 C# 将 MM-dd-YY hh:mmtt 识别为有效的日期时间格式?
- kubernetes - 尝试将文件写入 cifs 挂载时,Kubernetes Pod 拒绝访问
- php - 为什么我不能检查某些内容是否为空
- r - 由多个步骤组成的数据框修改
- python - Python - Rosalind 开放阅读框问题
- php - 如何修复此循环创建多个表
- javascript - TypeError:无法读取 null 的“channel_id”属性 | Discord.js Webhook 错误
- jsf - 在带有自定义 CDI 拦截器的 bean 上使用 OmniFaces @Param 时如何正确解析 NPE