1
如何使用特定的TextAppearance
繪製文本?繪製具有特定文本外觀的文本
這是我的代碼。
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setColor(Color.WHITE);
paint.setFakeBoldText(false);
paint.setTextSize(textSize);
// TODO: set the style of the text to a specific TextAppearance. E.g. @android:style/TextAppearance.DeviceDefault.Large.Inverse
canvas.drawText(context.getResources().getString(R.string.myString), textOffsetX, textOffsetY, paint);
我已經看過TypeFace
對象,但我不知道如何從TextAppearance創建字樣。