1、精度不一样,Rect是使用int类型作为数值,RectF是使用float类型作为数值
2、两个类型提供的方法也不是完全一致
Rect:
equals(Object obj) (for some reason it as it's own implementation of equals)
exactCenterX()
exactCenterY()
flattenToString()
toShortString()
unflattenFromString(String str)
RectF:
round(Rect dst)
roundOut(Rect dst)
set(Rect src)
本文主要探讨了Android中Rect与RectF两种类型的差异。重点介绍了它们在数值精度上的不同,即Rect采用整型int,而RectF采用浮点型float。此外还对比了两者所提供的方法区别。
5262

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



