转载:http://stackoverflow.com/questions/4913643/rect-and-rectf-in-android-sdk
UsingRectyou define its edges using integers and usingRectFthey are defined as floats.
Looking at them more carefully I have spotted a few differences actually. I will only list what one implementation has more compared to the other one.
Rect
- equals(Object obj)(for some reason it as it's own implementation of equals)
- exactCenterX()
- exactCenterY()
- flattenToString()
- toShortString()
- unflattenFromString(String str)
RectF
So apparently there are some differences.
本文深入探讨了Android SDK中的Rect和RectF的区别,包括它们如何定义边框、中心点计算、字符串转换等功能,并指出了一些关键差异。
844

被折叠的 条评论
为什么被折叠?



