简体   繁体   English

如何在Android中使用android.graphics.drawable.bitmapdrawable?

[英]How to use android.graphics.drawable.bitmapdrawable in android?

so I have used a function to create drawable from imagepath, and I get: android.graphics.drawable.bitmapdrawable@numbers 所以我使用了一个从imagepath创建可绘制对象的函数,并且得到了:android.graphics.drawable.bitmapdrawable@numbers

How do I use it? 如何使用? can it be used as ID? 可以用作ID吗? for example with normal drawable I would write like: findViewById(R.drawable.name); 例如,对于普通的drawable,我会这样写:findViewById(R.drawable.name); can I use same here? 我可以在这里使用吗?

findViewById(android.graphics.drawable.bitmapdrawable@numbers); findViewById(android.graphics.drawable.bitmapdrawable@numbers);

Thank you. 谢谢。

您不能使用findViewById(R.drawable.name),而必须使用R.id.someId

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NotSerializableException:android.graphics.drawable.BitmapDrawable - NotSerializableException: android.graphics.drawable.BitmapDrawable IonDrawable无法转换为android.graphics.drawable.BitmapDrawable - IonDrawable cannot be cast to android.graphics.drawable.BitmapDrawable NinePatchDrawable无法转换为android.graphics.drawable.BitmapDrawable - NinePatchDrawable cannot be cast to android.graphics.drawable.BitmapDrawable android.graphics.drawable.AdaptiveIconDrawable 无法转换为 android.graphics.drawable.BitmapDrawable 错误 - android.graphics.drawable.AdaptiveIconDrawable cannot be cast to android.graphics.drawable.BitmapDrawable error java.lang.ClassCastException:android.graphics.drawable.ColorDrawable无法转换为android.graphics.drawable.BitmapDrawable - java.lang.ClassCastException: android.graphics.drawable.ColorDrawable cannot be cast to android.graphics.drawable.BitmapDrawable java.lang.ClassCastException:android.graphics.drawable.BitmapDrawable无法转换为android.graphics.drawable.LayerDrawable - java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable cannot be cast to android.graphics.drawable.LayerDrawable 在目标类android.graphics.drawable.BitmapDrawable上找不到类型为int的getAlpha()方法 - Method getAlpha() with type int not found on target class class android.graphics.drawable.BitmapDrawable android.graphics.drawable.BitmapDrawable 不能转换为 java.lang.CharSequence - android.graphics.drawable.BitmapDrawable cannot be cast to java.lang.CharSequence 带有BitmapDrawable的Android动画可绘制错误 - Android Animation Drawable Error with BitmapDrawable Android:如何移动BitmapDrawable? - Android: How to move a BitmapDrawable?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM