在android开发过程中,经常会使用到旋转指定角度之后的图片,可以使用如下方式来实现
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_arrow"
android:fromDegrees="180"
android:toDegrees="180"
android:pivotX="50%"
android:pivotY="50%"/>
以上代码,将ic_arrow资源对应的图片旋转了180来使用,生成了一个新的资源文件
本文介绍了一种在Android开发中实现图片旋转的方法。通过XML标签设置,可以轻松地将指定资源的图片旋转特定角度,例如将名为ic_arrow的图片资源旋转180度,并围绕中心点进行旋转。
384

被折叠的 条评论
为什么被折叠?



