Android SDK中的Rect和RectF。

时间:2022-01-11 21:19:46

What is the difference between Rect and RectF in the Android SDK?

在Android SDK中Rect和RectF有什么区别?

2 个解决方案

#1


41  

Using Rect you define its edges using integers and using RectF they are defined as floats.

使用Rect可以使用整数定义它的边,使用RectF可以将它们定义为浮点数。

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

矩形

RectF

RectF

So apparently there are some differences.

所以很明显有一些不同。

#2


11  

Rect is final, RectF can be extended

Rect是最终的,可以扩展

#1


41  

Using Rect you define its edges using integers and using RectF they are defined as floats.

使用Rect可以使用整数定义它的边,使用RectF可以将它们定义为浮点数。

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

矩形

RectF

RectF

So apparently there are some differences.

所以很明显有一些不同。

#2


11  

Rect is final, RectF can be extended

Rect是最终的,可以扩展