スレッド上の2つのリスト配列に浮動小数点値を読み込みます。 値がロードされると、配列は2つのMainActivity静的List配列に設定されます。パスがアンドロイドアプリでキャンバスに描画されない
値はList配列に完全にロードされます。 Drawableを拡張してonDraw()をオーバーライドするDummyDrawクラスでは、MainActivity List配列の中にある値に基づいて円を描くことができますが、試してみると はパスオブジェクトを作成してパスオブジェクトにロードします。その後、パスを描画しようとすると、描画されません。 onDraw()内のコードは次のとおりです。
//inside onDraw() on DummyDraw class which extends Draw-able:
//in the constructor:
path = new path();
//inside onDraw():
for(int u = 0; u < MainActivity.valueList.size(); u++){
float x = MainActivity.valueList.get(u);
float y = MainActivity.valueList2.get(u);
if(u==0)path.moveTo(x,y);else path.lineTo(x,y);
//canvas.drawCircle(x,y,0.5f*densityMultiplier,points);
}
canvas.drawPath(path,points);// this doesn't draw anything to the screen
ありがとうございました。ありがとうございます。
属性を 'Paint'オブジェクト(' points')に設定しましたか?もちろん、 – Adithya
もちろん。 @Adithya私は読んでいて、path.rQuadTo()を実装する必要があります。私は今、このメソッドを実装しようとしていますが、成功はありません。 –