将位图设置为drawableLeft到EditText

use*_*649 4 android android-edittext

我正在开发一个应用程序,它从联系人数据库中检索联系人图像,并将其设置为EditText作为drawableLeft以及联系人姓名

我能够检索名称以及联系人图像作为位图,但无法将其设置为drawableLeft

era*_*tin 7

试试这段代码:

BitmapDrawable drawableLeft = new BitmapDrawable(getResources(), yourBitmap);
mYourEditText.setCompoundDrawablesWithIntrinsicBounds(drawableLeft, null, null, null);
Run Code Online (Sandbox Code Playgroud)