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
private int dp2px(Context context, float dp) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (dp * scale + 0.5f); } 感觉没多大用啊
The text was updated successfully, but these errors were encountered:
感谢作者,我用了两天,,终于学会了自定义动画效果了
Sorry, something went wrong.
@516457377 四舍五入保证精度
@SheepYang1993 没太懂。。0.5个像素。。怎么个保精度。。
@516457377
http://developer.android.com/guide/practices/screens_support.html
Then add 0.5f to round the figure up to the nearest whole number, when converting to an integer.
No branches or pull requests
private int dp2px(Context context, float dp) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dp * scale + 0.5f);
}
感觉没多大用啊
The text was updated successfully, but these errors were encountered: