Android Rect和RectF的区别
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)
sourceurl:http://longshuai2007.blog.163.com/blog/static/142094414201161832810371/
本文详细介绍了Android开发中Rect和RectF两种类的区别。主要从数据类型的精度角度进行对比,Rect使用int类型,而RectF使用float类型。此外还列举了两者各自特有的方法,如Rect中的exactCenterX等,以及RectF中的round方法等。
5263

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



