Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了用android:rotation xml旋转一个按钮大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我想要一个按钮(作为图像)顺时针旋转只为UI.我不想旋转onClick按钮.只需在xml文件中旋转即可. android:旋转对我不起作用.

我的代码

<按钮
        机器人:layout_width = “WRAP_CONTENT”
        机器人:layout_height = “WRAP_CONTENT”
        android:text =“新按钮”
        机器人:背景=“@绘制/键”
        机器人:旋转= “ – 90”
        android:id =“@ id / button”
        机器人:layout_gravity = “右侧|左”
        机器人:layout_centerVertical = “真”
        android:layout_centerHorizo​​ntal =“true”/>

解决方法

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://scheR_352_11845@as.android.com/apk/res/android">
<rotate android:fromdegrees="0"
    android:todegrees="360"
    android:pivotX="50%"
    android:pivotY="50%"
    android:duration="600"
    android:repeatMode="restart"
    android:repeatCount="infinite"
    android:interpolator="@android:anim/cycle_interpolator"/>

</set>

时钟明智 – 使用积极的todegrees

反时钟 – 使用负值todegrees

大佬总结

以上是大佬教程为你收集整理的用android:rotation xml旋转一个按钮全部内容,希望文章能够帮你解决用android:rotation xml旋转一个按钮所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。