위젯에서 확장 된 ProgressBar 클래스를 사용하고 싶습니다. 정말 간단한 MyProgressBar를 만들었고 이것을 표준 액티비티 레이아웃에 배치하면 작동합니다. 물론 디자이너의 MyProgressBar 속성에서 "android : attr/progressBarStyleHorizontal"스타일 속성을 설정합니다.사용자 정의 ProgressBar를 만들고 위젯에서 사용하는 방법?
하지만 위젯 레이아웃과 동일하게 배치하면 이클립스의 레이아웃 디자이너에서 잘 볼 수 있지만 위젯은 traget에서 작동하지 않습니다.
공용 클래스 MyProgressBar는 {
public MyProgressBar(Context context) {
super(context);
}
public MyProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected synchronized void onDraw(Canvas canvas) {
// First draw the regular progress bar, then custom draw our text
super.onDraw(canvas);
}
의 ProgressBar를 확장 : 전용 "문제 loaing 위젯은"메시지가 MyProgressBar에 대한
소스 코드는 여기에 대상 장치 ....에 .... 대신 위젯 레이아웃을 보여 주었다있다