Can you load a drawable from a sub directory in the assets
(not the drawable folder) folder?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I recommend to use this
which returns properly scaled drawable thanks to resources ...
Hope this help:
Here is function that does this for you.
Check the returned Drawable variable for null as null may return if the path is invalid or there is an IOException.
At this version you can't, if you make a sub folder within your drawable folder you can't use it in your xml file, it won't be recognized when you use android:src.
Take a look at this thread: Can the Android drawable directory contain subdirectories?
Yes you can create a
Drawable
object from anInputStream
using the createFromStream() method.This helped getting the right density