答案 0 :(得分:1)
几天后我找到了路!我在我的canvas
课程中使用了CustomKeyboardView
,所以我只是使用条件来绘制它:\
public class CustomKeyboardView extends KeyboardView {
public CustomKeyboardView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
Paint paint = new Paint();
canvas.drawPaint(paint);
paint.setColor(Color.WHITE);
paint.setTextSize(16);
boolean abc = false ;
List<Keyboard.Key> keys = getKeyboard().getKeys();
for (Keyboard.Key key : keys) {
if (key.codes[0] == -2)
{
canvas.drawText("My Text", key.x, key.y, paint);
}
}
}
}