1
我想设置图像资源与弦乐无法解决方法setCompoundDrawablesWithIntrinsicBounds
我有设置setCompoundDrawablesWithIntrinsicBounds的问题,它不断告诉我
cannot resolve method setCompoundDrawablesWithIntrinsicBounds(android.graphics.drawable.Drawable, 0, 0, 0);
我已经通过网上查,甚至在计算器,我的实现似乎是正确的,但我无法编译。
String uri = "drawable/my_drawable_image";
int imageResource = getResources().getIdentifier(uri, null, getActivity().getPackageName());
Drawable image = getResources().getDrawable(imageResource);
myTextView.setCompoundDrawablesWithIntrinsicBounds(image, 0 ,0 , 0);
请问我在做什么错?
谢谢! .... –
不客气 – Blackbelt