Issue
I want to add an icon to a Button that I created from Java, after hours I didn't find a solution yet...
I have something like this:
Button button = new Button(context);
And I'd like to have something like this:
button.setIcon(Icon myicon);
Is this possible? ;)
Solution
You can use the MaterialButton
:
MaterialButton button = new MaterialButton(this);
button.setIcon(ContextCompat.getDrawable(this,R.drawable.ic_add_24px));
button.setText("Button");
Answered By - Gabriele Mariotti
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.