We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
初始化的时候,ondraw中代码不执行,
if (offLineWidth > 0) { final float cy = offLineWidth * 0.5f; rect.set(spotX - cy, centerY - cy, endX + cy, centerY + cy); paint.setColor(offColor); canvas.drawRoundRect(rect, cy, cy, paint); }
因为offLineWidth在onlayout中被赋值为0.建议修复.
@Override protected void onLayout(boolean changed, int left, int top, int right, super.onLayout(changed, left, top, right, bottom); final int width = getWidth(); final int height = getHeight(); radius = Math.min(width, height) * 0.5f; centerY = radius; startX = radius; endX = width - radius; spotMinX = startX + borderWidth; spotMaxX = endX - borderWidth; spotSize = height - 4 * borderWidth; spotX = toggleOn ? spotMaxX : spotMinX; offLineWidth = 0; }
可以把这行offLineWidth = 0;改为调用calculateEffect(toggleOn ? 1 : 0);
The text was updated successfully, but these errors were encountered:
感谢 已解决
Sorry, something went wrong.
No branches or pull requests
初始化的时候,ondraw中代码不执行,
因为offLineWidth在onlayout中被赋值为0.建议修复.
可以把这行offLineWidth = 0;改为调用calculateEffect(toggleOn ? 1 : 0);
The text was updated successfully, but these errors were encountered: