【问题标题】:Drawing circle gradually in android在android中逐渐画圆
【发布时间】:2016-02-23 11:35:24
【问题描述】:

我想像这样在android中逐渐绘制一个圆圈:

我应该如何开始? 需要做什么?

【问题讨论】:

标签: android android-animation android-canvas android-drawable android-design-library


【解决方案1】:
 ProgressBar p
 p=(PregressBar)findViewById(R.id.p);
 ObjectAnimator animation = ObjectAnimator.ofInt (p, "progress", 0, 100);
    animation.setDuration (3000); 
    animation.setInterpolator (new DecelerateInterpolator ());
    animation.start ();`

然后在xml中

  <ProgressBar
android:id="@+id/p"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="@dimen/progreess_circle"
android:layout_height="@dimen/progreess_circle"
android:layout_gravity="center"
android:rotation="270"
android:progress="0"
android:drawingCacheQuality="low"
android:progressDrawable="@drawable/circular" />

Circular.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:innerRadiusRatio="2.3"
android:shape="ring"
android:thickness="10sp" >
<solid android:color="@color/yellow_text_color" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-14
    • 2021-05-09
    • 1970-01-01
    • 2011-01-29
    • 1970-01-01
    相关资源
    最近更新 更多