我在我的应用程序中使用Paint绘制线条。我使用了StrokeWidth(0),即使我感觉线条较粗。所以请让我知道如何减少线条的粗细。
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
Typeface typeFace = Typeface.create("sans-serif", Typeface.NORMAL);
Typeface typeFaceBold = Typeface.create("sans-serif", Typeface.BOLD);
paint.setTextSize(mFontSize);
paint.setTypeface(typeFace);
paint.setColor(mFontNormalColor);
paint.setAntiAlias(true);
paint.setStyle(Paint.Style.FILL);
paint.setStrokeWidth(2 / getResources().getDisplayMetrics().scaledDensity);
paint.setTextAlign(Align.CENTER);