我在 CustomDialog 中有一个简单的视图:
public class ColorPickerDialog extends Dialog
{
private static class ColorPickerView extends View
{
ColorPickerView(Context c, int color)
{
super(c);
//...
}
@Override
protected void onDraw(Canvas canvas) {
//...
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(CENTER_X*2, CENTER_Y*2);
}
}
public ColorPickerDialog(Context context,
int initialColor) {
super(context);
mInitialColor = initialColor;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new ColorPickerView(getContext(), mInitialColor));
}
}
如何添加到这个视图 SeekBar?