
我找到了Shape Drawable类型的戒指.
<shapexmlns:androID="http://schemas.androID.com/apk/res/androID"androID:shape="ring"androID:innerRadius="75dp"androID:thickness="25dp"androID:useLevel="false">
与ArcShape(startAngle,sweepAngle)方法一起使用.
ShapeDrawable shape = new ShapeDrawable(new ArcShape(0,360)); shape.setIntrinsicHeight(100);shape.setIntrinsicWIDth(100);shape.getPaint().setcolor(color.BLACK);
然而,问题在于无法找到可绘制形状的扫掠角度属性或为ArcShape创建内半径的能力.
我试图制作一个流畅的动画.
解决方法 旧线程,但我认为它仍然有用.我设法使用上面的代码获得了类似的行为:
<@R_309_3419@ xmlns:androID="http://schemas.androID.com/apk/res/androID"> <item> <shape androID:shape="oval"> <size androID:height="56dp" androID:wIDth="56dp"/> <stroke androID:wIDth="6dp" androID:color="#FFFFFF"/> </shape> </item> <item> <shape androID:shape="oval"> <size androID:height="50dp" androID:wIDth="50dp"/> <stroke androID:wIDth="6dp" androID:dashGap="140dp" androID:dashWIDth="16dp" androID:color="#FF0000"/> </shape> </item></@R_309_3419@>
这里的关键是使用dashGap和dashWIDth值,直到获得所需的图像.
总结以上是内存溢出为你收集整理的java – Animate Android Ring Shape的扫描角度全部内容,希望文章能够帮你解决java – Animate Android Ring Shape的扫描角度所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)