Pergunta

How can I add a "drawable left" icon to a button object?

I mean something like this:

Button button = new Button();
button.setDrawableLeft(R.drawable...);
Foi útil?

Solução

Use Button.setCompoundDrawablesWithIntrinsicBounds(..) which relates to android:drawableLeft attribute.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top