测量文字长度

    技术2026-05-10  5

    Paint mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);   mTextPaint.setColor(Color.WHITE);   // Define the string.   String displayText = “Hello World!”;   // Measure the width of the text string.   float textWidth = mTextPaint.measureText(displayText); 

    最新回复(0)