Android - простой путь, использование arcTo вызывает "UnsupportedOperationException?" - PullRequest
1 голос
/ 01 марта 2010

Я пытаюсь создать простой путь в методе onDraw созданного мной объекта SurfaceView, и редактор макетов постоянно выдает мне «UnsupportedOperationException: null» всякий раз, когда я добавляю команду arcTo в путь.

Как мне это исправить?

Спасибо,

Райан

public class myView extends SurfaceView
{
    private Path myPath;

    public myView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas)
    {
        super.onDraw(canvas);

        //set bounds
        final int top = 0 +this.getPaddingTop();
        final int bottom = this.getMeasuredHeight() - this.getPaddingBottom();
        final int left = 0 + this.getPaddingLeft();
        final int right = this.getMeasuredWidth() - this.getPaddingRight();
                int someHeight;
                int someWidth;
                innerLeft = new RectF(left + someWidth, bottom - otherHeight,
                       left + someHeight + 10 * 2, bottom);

        myPath.moveTo(left, bottom);
        myPath.lineTo(left, top + 10);
        myPath.arcTo(innerLeft, 180, 90);
        myPath.close();
    }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...