首先放一个超链接 一叶飘舟的博客地址http://blog.csdn.net/jdsjlzx/article/details/54845517
换行放些代码
一些类
public NewEditText(Context context, AttributeSet attrs) {
super(context, attrs);
// 初始化密码画笔
mPwdPaint = new Paint();
mPwdPaint.setColor(Color.BLACK);
mPwdPaint.setStyle(Paint.Style.FILL);
mPwdPaint.setAntiAlias(true);
// 初始化密码框
mRectPaint = new Paint();
mRectPaint.setStyle(Paint.Style.STROKE);
mRectPaint.setColor(Color.LTGRAY);
mRectPaint.setAntiAlias(true);
}
ok 基本上没问题
放些图片试试
也可以 有些大 换个小点的
标题变大引人注意
// 计算每个密码框宽度
int rectWidth = (mWidth - PWD_SPACING * (PWD_LENGTH - 1)) / PWD_LENGTH;
// 绘制密码框
for (int i = 0; i < PWD_LENGTH; i++) {
int left = (rectWidth + PWD_SPACING) * i;
int top = 2;
int right = left + rectWidth;
int bottom = mHeight - top;
mRect = new Rect(left, top, right, bottom);
canvas.drawRect(mRect, mRectPaint);
}
可以可以