Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
(x1,y1) と (x2,y2) としましょう。OnDraw()メソッドを使用して、これらの点の間に線を引く必要があります。
OnDraw()
としてみました
Paint mPaint = new Paint() mPaint.setColor(Color.BLACK); path.moveTo(x1, y1); path.lineTo(x2, y2); canvas.drawPath(path, mPaint);
しかし、それは機能していません
よろしく、
サディア
このようにしてみてください
canvas.drawLine(p1.x, p1.y, p2.x, p2.y, paint);