尝试使用 RoundedDrawable 类插入和图像到圆形图像(从https://github.com/vinc3m1/RoundedImageView获取)。
图片来自 URL。如果我将 Koushik dutta 的 ION 库用于图像加载部分,则会收到以下错误:
09-27 21:35:06.187: E/AndroidRuntime(12606): FATAL EXCEPTION: main
09-27 21:35:06.187: E/AndroidRuntime(12606): Process: com.ylg.maps, PID: 12606
09-27 21:35:06.187: E/AndroidRuntime(12606): java.lang.ClassCastException: com.koushikdutta.ion.IonDrawable cannot be cast to android.graphics.drawable.BitmapDrawable
09-27 21:35:06.187: E/AndroidRuntime(12606): at com.ylg.otherlibs.RoudImageViewForMap.loadBitmap(RoudImageViewForMap.java:70)
09-27 21:35:06.187: E/AndroidRuntime(12606): at com.ylg.otherslibs.RoudImageViewForMap.onDraw(RoudImageViewForMap.java:80)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.view.View.draw(View.java:14465)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.view.View.draw(View.java:14350)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.view.View.buildDrawingCache(View.java:13673)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.view.View.buildDrawingCache(View.java:13522)
09-27 21:35:06.187: E/AndroidRuntime(12606): at com.ylg.maps.Mapsthree.createDrawableFromView(Mapsthree.java:454)
09-27 21:35:06.187: E/AndroidRuntime(12606): at com.ylg.maps.Mapsthree.loadFriends(Mapsthree.java:417)
09-27 21:35:06.187: E/AndroidRuntime(12606): at com.ylg.maps.Mapsthree.access$24(Mapsthree.java:402)
09-27 21:35:06.187: E/AndroidRuntime(12606): at com.ylg.maps.Mapsthree$LoadUsers.onPostExecute(Mapsthree.java:660)
09-27 21:35:06.187: E/AndroidRuntime(12606): at com.ylg.maps.Mapsthree$LoadUsers.onPostExecute(Mapsthree.java:1)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.os.AsyncTask.finish(AsyncTask.java:632)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.os.AsyncTask.access$600(AsyncTask.java:177)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.os.Handler.dispatchMessage(Handler.java:102)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.os.Looper.loop(Looper.java:136)
09-27 21:35:06.187: E/AndroidRuntime(12606): at android.app.ActivityThread.main(ActivityThread.java:5001)
09-27 21:35:06.187: E/AndroidRuntime(12606): at java.lang.reflect.Method.invoke(Native Method)
09-27 21:35:06.187: E/AndroidRuntime(12606): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
09-27 21:35:06.187: E/AndroidRuntime(12606): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
看起来 ION 库支持 ImageView 不支持自定义的 Image View?有没有人遇到过这样的问题,如果有,是怎么解决的?
谢谢!