Author Archives: coder4

Android中Vector Drawable发虚的解决方法

具体过程可以参考:《为毛矢量图图标还发虚?》

这里只贴结论:

  1. 设置 ImageView 的 ScaleType 为 ScaleType.FIT_XY 即可。
  2. 或者 把 height 和 width 设置为一个较大的值,避免图标放大发虚

<vector
android:height="120dp"
android:viewportHeight="75.0"
android:viewportWidth="75.0"
andro[......]

继续阅读

Retrofit 2 关于HTTP返回码的一点小坑

在Retrofit 1 时,会在onError中返回并抛出HttpException,但是在2中,不会再回调onError了,而是会在onNext中,这个任务就需要客户端自己处理。

https://futurestud.io/tutorials/retrofit-2-simple-error-handling

参考如下:

Error Handler in Action

etrofit 2 has a different concept of handling "succe[......]

继续阅读