Android Custom button with imageview and textview inside?

前端 未结 6 2030
一整个雨季
一整个雨季 2021-01-04 21:27

I\'m looking to create a custom button. This button ideally would have an image on the left and a textview on the right. How would I accomplish this?

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-04 21:48

    If you want to write code to do this, use setCompoundDrawables() of the Button class to decide where the drawable should appear relative to text. Look for the API for more details.

提交回复
热议问题