1
Je veux dessiner 4 coins au centre de l'appareil en utilisant la toile.Comment dessiner 4 coins Edges centre de l'appareil
Vous aimez cette
J'essaie cette
Paint myPaint = new Paint();
myPaint.setColor(Color.GREEN);
myPaint.setStyle(Paint.Style.STROKE);
canvas.drawRect(
getLeft()+(getRight()-getLeft())/4,
getTop()+(getBottom()-getTop())/4,
getRight()-(getRight()-getLeft())/4,
getBottom()-(getBottom()-getTop())/3,myPaint);
Mon résultat
utilisation [drawPath] (https://developer.android.com/reference/android/graphics/Canvas.html# drawPath (android.graphics.Path, android.graphics.Paint) au lieu de drawRect. – Blackbelt
utiliser le vecteur Dessiné pour cela .. http://stackoverflow.com/a/40217644/6893465 –
... ou un simple 9 patch –