我想創建一個進度條,當增加時會自動向上滑動。我已經對滑動位進行了排序(使用java),但現在想要創建一個自定義進度條組件。這是我到目前爲止有:Android自定義進度條組件
public class Smooth_Progress_Bar extends ProgressBar{
public Smooth_Progress_Bar(Context context) {
super(context);
}
}
我使用這個XML代碼:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.todddavies.content.smoothprogressbar.Smooth_Progress_Bar
android:layout_width="fill_parent"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_height="50dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:progressDrawable="@drawable/pb"/>
</LinearLayout>
我親近的直接動力:/
我強烈懷疑我在做什麼java比特大錯了。我保證打出正確的答案!
你可以發佈從LogCat獲得的堆棧跟蹤嗎? – kabuko 2011-06-14 20:33:18