转载: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

  • round(Rect dst)
  • roundOut(Rect dst)
  • set(Rect src)

So apparently there are some differences.

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android(安卓)Gallery组件详解
  2. Android 屏幕刷新机制:ViewRootImpl、Chor
  3. 解决onConfigurationChanged不被调用
  4. Android DataBinding & MVVM
  5. if(Build.VERSION.SDK_INT>=Build.VERSIO
  6. Android(安卓)Sensor HAL层分析
  7. Android开发の开发环境搭建
  8. Android(安卓)实现事件监听器的五种处理
  9. 历史版本1:Android:应用程序基础
  10. Android通知栏监听之NotificationListene