android - 单击箭头时如何为展开/折叠箭头设置 180 度动画?
问题描述
我linearLayout
在可展开的回收站视图中有一个展开更多图标
我想当点击 linearLayout 时,点击布局会展开,这个图标会像下面一样随着动画旋转 180 度 -
这是我的操作代码:
rotationAngle = rotationAngle == 0 ? 180 : 0;
expandArrow.animate().rotation(rotationAngle).setDuration(500).start();
whererotationalAngle=0;
是全局声明的。
你能给我一个合适的解决方案吗?
解决方案
ImageV.animate().rotation(isExpanded()? -180 : 0 )
.setInterpolator(new SineInOut60())
.setDuration(2000)
.withLayer();
推荐阅读
- java - 带有 Swing 客户端的 Spring Boot 后端
- c# - 使用 Linq to Datatable 显示日期时间的最佳方法是什么?
- java - 为什么 XSSFRichTextString.applyFont() 不能像在 java doc 中那样工作?
- javascript - 设置有效期20分钟
- php - 教义 - 如何查看在刷新时会运行哪些查询
- c - 如果(条件)从链表中删除一个节点
- javascript - JavaScript/jQuery 如何选择所有动态创建的音频元素?
- python-3.x - 使用列和索引标签填充 pandas DataFrame
- html - 基于 css 选择器的 DOM 树表示
- angular - 在 nrwl 工作区中用玩笑解决路径不正确