How can I achieve this:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_text"
android:drawableLeft="@drawable/button_icon"
... />
via code?
So far, I've got this:
btn = new Button(this);
btn.Text = "Maps";
btn.Click += StartSpotify;
btn.Gravity = GravityFlags.Left | GravityFlags.CenterVertical;
btn.TextSize = 30;
btn.SetPadding(60, 0, 0, 0);
btn.LayoutParameters = loParams;
btn.SetBackgroundColor(Android.Graphics.Color.Transparent);
col1row2.AddView(btn);
which creates the button correctly, but I need to add an image to the left of the text on the button.
Easily achievable via axml, but I cannot figure it out via code nor can I find any help on the API or samples?