Skip to content
New issue

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

动态 setProgress 没反应,静态设置setProgress 也是错的 #3

Open
732275239 opened this issue Jun 28, 2023 · 1 comment
Open

Comments

@732275239
Copy link

No description provided.

@732275239
Copy link
Author

代码修复如下:
@OverRide
public void setProgress(int progress) {
this.progress = progress;
float percent = progress / (maxProgress * 1.0F);
final int ivWidth = mBotIv.getWidth();
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) mProgressIv.getLayoutParams();
lp.width = (int) (percent *ivWidth);
mProgressIv.setLayoutParams(lp);
mProgressIv.postInvalidate();
}

测试没问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant